I have successfully grabbed json data from a URL. Code uses is
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
Open in new window
The output of the can be seen here Link to output
I now need to make scene of this data. How would I create an array from this information that I can echo with some basic formatting?
Dave, following on from your suggestion I have updated the code to this
Open in new windowThis works fine. Was this what you had in mind?
Ray, your solution works perfectly and I see a lot of benefit from initially creating a file to receive the data and grabbing this as and where needed. The next phase of this particular project is to cache the resulting data so I can limit calls to the external source. I may be using your expertise again to help with this question.
Cheer and thanks to both of you.