开发者

Use PHP to search a list of files within directorys that contain a certain string

开发者 https://www.devze.com 2023-01-24 19:08 出处:网络
I am trying to get P开发者_StackOverflowHP to search a list of files that are contained within a directory for a certain string.

I am trying to get P开发者_StackOverflowHP to search a list of files that are contained within a directory for a certain string.

For example PHP would search each of these text files for the string that you specify and then echo the names of the files out:

XXXX/test.txt

XXXX1/test.txt

XXXX3/test.txt

Is there way that I would be able to go about doing this?


First, consult the manual:

http://php.net/manual/en/ref.filesystem.php

http://www.php.net/manual/en/ref.dir.php

Then, if you are unsure how to perform some specific part of your problem, formulate a question about that, showing what you've tried so far and where it isn't working as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消