I am calling the Crunchbase API and it gives me long response, so long that the response has multiple pages that can be accessed with ?page=# at the end of the api url.
My question is how do I write some code to run the script once and it will go through all of the pages available without me having the change the page number every time I call the script?
Simplified version of my code:
$url = "https://api.url.com/tags/?page=2";
$jsondata = file_get_contents($url);
$array = json_decode($jsondata,true);
var_dump($array);
foreach($array as $key => $value) {
mysql_query(" INSERT into cbcompanies (
`column1`)
VALUES (
'{$value['foo']}') ",$con);
}