在250个文件中搜索字符串 [英] Search for a string in 250 files

查看:60
本文介绍了在250个文件中搜索字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我想做一个php脚本,在目录中的250个文件中搜索字符串
我可以执行此操作,但只能使用此代码对1个文件进行操作

hello
i want to do a php script that searches for a string in 250 files in a directory
i can do this but only on 1 file using this code

<?
$mcc=$_REQUEST[mcc];
$mnc=$_REQUEST[mnc];
$file = "http://******************/data/MEP-09070-001";
$file2=file_get_contents($file);
if(!strpos($file2, "MCC=$mcc
MNC=$mnc")) {
echo "String not found!";
}
else{echo "String found!";
echo "<br />";
$file = str_replace("*************/data/", "", $file);
echo $file;}

?> 



求助者
在此先感谢



Pleaseeee help
Thanks in advance

推荐答案

mcc =


_REQUEST [mcc];
_REQUEST[mcc];


mnc =


这篇关于在250个文件中搜索字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆