I think you mean that you want to search the actual site. Yes?
This can be done using eg fopen() , but it is going to be very slow, opening each site and searching through the data stream.
Probably what you need to do is to scrape the site content and store that in your db, then you can search it with full text search. You'll need to check sites for updates on a regular basis to keep the content up to date.
You don't have to write your own web-crawler as there are plenty of tools around on SourceForge and the like.