I won't include any code with this but
- open the root WEB directory
- read through it, if you come accross a file, open it check if it contains the string
else (it's a directory) open that and repeat step 2.
If you need the code (not in detail) then leave a reply to this and I'll see if I have time