Retrieve Page Count from JSON Headr

After a ridiculous amount of googling and experimenting I can not figure out how to retrieve X-pages data from the JSON Header using PHP (For /markets/{region_id}/orders/ ) I can do the rest of what I want, just can not solve this. Any tips, clues, help?

Thank you.

It depends on what method you’re using to download from the endpoints.

$json = file_get_contents(‘‘.$nextRegion.’/orders/?datasource=tranquility&order_type=all&page=’.$varPage);

$arrItems = json_decode($json, true);

In that case the header are in the $http_response_header variable

Just in case you missed it, there are some really good php libraries, that may make things a fair bit easier.

Thank you so much.