0
I need to return some search results "ex: Digital Agency" from the first page of Google using preg_match + Regex, but it is not returning all 10 values in the array, only the first. How do I resolve?
Ex:
$document = file_get_contents('https://www.google.com/search?q=Ag%C3%AAncia+Digital');
preg_match_all('/<li class=\"g\">([^`]*?)<\/li>/', $document, $matches);
print_r($matches);
I tested your code here, came an array with two keys and 10 elements (html) in each but I had to use the option to display browser source code.
– rray