You need to understand what you are doing.
In your example, you list all filenames ending with '.php', then you look for an ip address in the filenames.
You could do this two ways:
1. Find all files with ip addresses in them, then sort out the php-files
2. Find all php-files, then search each file for ip addresses.
Both ways work, without too much thinking I'd say the first method requires little less coding.
But if you want to search places with large amount of files the second method is probably faster - it's quicker to search for filenames than to search for a string in files.
Last edited by pingu; 06-06-2014 at 06:02 AM.
Reason: Edit - replace "first" w "second"