Use PHP to search a list of files within directorys that contain 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.txtIs 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.
精彩评论