Sorry to ask this question here it is not completly related to PHALCON, In my project I need to get JSON from an API, this API divide their information in to pages, I use some code like this to get JSON from API
$LastPage = 750; $Type1 = []; $Type2 = []; for ($i = 0; $i < $LastPage; $i = $i + 1) { $UrlJson = "https://example.com/page?".$i; $contents = @file_get_contents($UrlJson); if ($contents !== false) { foreach($contents['entity'] as $entity){ array_push($Type1, $entity['typeOne']) array_push($Type2, $entity['typeTwo']) } } }
each json have size around 400 KB this process take 20 minute any idea how can I make it faster to receive the info from API, something like read a few page together?