PHP文本數(shù)據(jù)庫的搜索方法
更新時(shí)間:2006年10月09日 00:00:00 作者:
PHP文本數(shù)據(jù)庫的搜索方法 searchstr=("/".preg_quote($searchstr)."/"); //$searchstr是查找的關(guān)鍵字 $records=file($file);//獲取所有的記錄數(shù) //$file是查找的數(shù)據(jù)文件 $search_reocrds=preg_grep ($searchstr, $records);//開始查找記錄 //$search_reocrds為查找到的記錄數(shù) unset($records); if($search_records){ //開始顯示記錄,寫下你自己的處理程序******************** while (list ($key, $val) = each ( $search_records)) { echo "$val
"; } //**************************************************** }
"; } //**************************************************** }
您可能感興趣的文章:
相關(guān)文章
用PHP動(dòng)態(tài)創(chuàng)建Flash動(dòng)畫
用PHP動(dòng)態(tài)創(chuàng)建Flash動(dòng)畫...2006-10-10Apache+php+mysql在windows下的安裝與配置圖解(最新版)
對(duì)于php環(huán)境的配置圖文教材2008-11-11php替換超長(zhǎng)文本中的特殊字符的函數(shù)代碼
php替換超長(zhǎng)文本中的特殊字符的函數(shù),主要就是通過str_replace實(shí)現(xiàn)字符的簡(jiǎn)單體會(huì)2012-05-05