-2
Guys the following I have a file_get_contents in php, but this API sometimes goes off the air and it takes a long time to answer, it would be like for a time limit if past this time returns an error.
Or any idea how to do this using Curl, I did so:
$url = "..../stations.json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$response=curl_exec($ch);
curl_close($ch);
$response = json_decode($response);
There’s an answer on Soen: Setting Curl’s Timeout in PHP
– LipESprY
Thanks worked out !
– Adilmar Coelho Dantas