I have php function to get item from some page, the item have pagination
function get_content($link){
$string = file_get_contents($link);
$regex = '/https?\:\/\/[^\" ]+/i';
preg_match_all($regex, $string, $matches);
//this is important
foreach($matches as $final){
$newarray[] = $final;
}
if(strpos($string,'Next Page')){ //asumme the pagination is http://someserver.com/content.php?page=2
get_content($link);
}
return $newarray;
}
Question :
Is it possible to using looping function for that case?
When I try it, why I only get 1 page of array? I mean if there is 5 page and each page have 50 links, I only get 50 links when I try to print_r the result, not 250.
Thank you
$_GET
? It's MUCH easier to use that.