PHP, operating (as it does) on a web server, can certainly issue a request to another web site (e.g. Google) and retrieve, then analyze, the output (the HTML) that this web site produces.
I have, for example, created a web-page that polls our POP-server (e-mail) to list the mail that is queued, then delete the junk mail that we do not want to see.
For you, the first step should be to very carefully define what your goal is. Assuming that you cannot achieve what you're looking for by creating more-precisely-defined Google queries, you'll need to frame your goal in terms of something that can be programmed. Once you've defined something that "can be done automatically, by a blind stupid computer," then you can certainly create that using PHP (or Perl).