I have the following code:
$urls = file_get_contents('https://www.google.com/#q=test');
preg_match_all('/\b(?:(?:https?|http):\/\/|www\.)[-a-z]*.com/i', $urls, $content);
$i = 10;
while ( $i <= 50 ) {
$i+= 10;
$urls2 = file_get_contents('https://www.google.com/#q=test&start=".$i."'); // pagination Google search Results
preg_match_all('/\b(?:(?:https?|http):\/\/|www\.)[-a-z]*.com/i', $urls2, $contentLoop);
$totalArray = array_push($content,$contentLoop);
}
print_r($totalArray);
This only print number 6
In the while, how do I add several arrays within a single array?
I tried to use the function array_push, but got no success so far