输入banner图图片脚本导航/分类

php查找文件夹下文件内容

error_reporting(0);//这个最好加上 因为file_get_contents遇到目录时会出错
$key=$_GET['key'];$dir=dirname(__FILE__);$file=scandir($dir);foreach($file as $f){$tmp=file_get_contents($f,1024*100);if(stripos($tmp,$key))echo $f."
";}?>

还可以这样:(基于正则表达式匹配)

";//注意添加了前后两条斜线 不然会出错}?>