This can save a lot of time, otherwise grep will go through an entire directory recursively searching every type of file but what if you are sure you only need to search txt or php files?
grep -r -i --include=*.php "what you are searching for" /the/path/to/search