0

I've came up with a script to find a certain string in a directory, but when I do it, it only shows the first string and not the others... how would I go about it showing all of the other strings?

The code,

$result = exec("grep -r admin@admin.com /var/www/html/files/*");
echo $result;

Thank you!

1 Answers1

0

Try exec("grep -r admin@admin.com /var/www/html/files/*", $result);. According to PHP manual exec return the last line from the result of the command

Saumini Navaratnam
  • 8,439
  • 3
  • 42
  • 70