You can get what you need without using grep. Grep is a convenient tool when you are on the command line, but you can do what you need with just a little PHP code.
This small snippet, for example, gives results similar to grep:
$path_to_check = ''; $needle = 'match'; foreach(glob($path_to_check . '*.txt') as $filename) { foreach(file($filename) as $fli=>$fl) { if(strpos($fl, $needle)!==false) { echo $filename . ' on line ' . ($fli+1) . ': ' . $fl; } } }
ghbarratt
source share