Home > Backend Development > PHP Tutorial > Search method of PHP text database_PHP tutorial

Search method of PHP text database_PHP tutorial

WBOY
Release: 2016-07-21 16:10:13
Original
869 people have browsed it

PHP text database search method searchstr=("/".preg_quote($searchstr)."/"); //$searchstr is the search keyword $records=file($file);//Get the number of all records/ /$file is the searched data file $search_reocrds=preg_grep ($searchstr, $records); //Start to search for records //$search_reocrds is the number of records found unset($records); if($search_records){ //Start To display records, write your own handler************************ while (list ($key, $val) = each ( $search_records)) { echo " $val
"; } //****************************************** ************ }

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314287.htmlTechArticleSearch method for PHP text database searchstr=("/".preg_quote($searchstr)."/"); //$searchstr is the search keyword $records=file($file);//Get the number of all records //$file is the search data...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template