curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
//PAGE LOAD TIME
if(!curl_errno($ch)){
$cinfo = curl_getinfo($ch);
echo 'Page loaded in '.$cinfo['total_time'].' seconds'."<br/><br/>";
}
curl_close($ch);
return $data;
}
whenever I am calling curl function its displaying loadtime and I cant even create one more curl function if we can create how to create multiple curl function with same url.?
$loadMessageDisplayed = FALSE;
function whatever() {
global $loadMessageDisplayed;
...
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
//PAGE LOAD TIME
if(!curl_errno($ch) && !$loadMessageDisplayed){
$cinfo = curl_getinfo($ch);
echo 'Page loaded in '.$cinfo['total_time'].' seconds'."<br/><br/>";
$loadMessageDisplayed = TRUE;
}
curl_close($ch);
return $data;
}