PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Also, once I get this working, I plan to have it display the pages indexed for multiple sites. I was planning to load them into an array from a flat file - is that the right approach? (the array part I have already sorted out thanks to the people here on this forum).
Disregard the number of pages...it seems to be showing the correct number now. I would still like to know if I am passing the querry to Google the most effective/efficient way though.
Also, once I get this working, I plan to have it display the pages indexed for multiple sites. I was planning to load them into an array from a flat file - is that the right approach? (the array part I have already sorted out thanks to the people here on this forum).
I really hate it when people bump their topics. Anyway...
No, you aren't doing this in the most efficient way you could be. Your PHP script will stop until the page from Google has been loaded. That's not really a problem if you're only checking a single site but if you're checking lots of sites the script is going to be really, really slow. Curl, or curl multi, is a better approach (in my opinion).
Your script also suffers from a reliance on Google's page format. If they change the wording, or even just the layout, your script will break.