This question already has an answer here:
I want to parse the amount of hits a certain google search contains and store that in a PHP variable.
Example:
http://www.google.co.uk/search?as_epq=hello
returns a page containing: 'About 1,830,000,000 results' under the search bar.
All I want to take is the 1830000000 bit.
I'm pretty sure I use preg match but am completely useless at reg expressions, never been able to get my head around it.
The closet I have come is:
$adamHTML = file_get_contents('http://www.google.co.uk/search?as_epq=hello');
preg_match('/About/', $adamHTML, $return);
print_r($return);
Which gives me all the instances of 'About'. But how do I grab the number?
Thanks for any help...
</div>