PHP text database search method, read the PHP text database search method, searchstr = ("> <LINKhref =" http://www.php100.com//statics/style/headfloor_950_081205.css "type = text/cssrel = styleshee PHP text database search method searchstr = ("/". preg_quote ($ searchstr ). "/"); // $ searchstr is the search keyword $ records = file ($ file ); // Obtain the number of all records // $ file is the data file to be searched for $ search_reocrds = preg_grep ($ searchstr, $ records ); // start searching for records // $ search_reocrds indicates the number of records found unset ($ records); if ($ search_records) {// start displaying records, write down your own processing program ********************* while (list ($ key, $ val) = each ($ search_records) {echo "$ val
";} //************************************** **************}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.