CURL PHP: Get information regarding a specific transfercurl_getinfo — Get information regarding a specific transfer – curl_getinfo()

Wednesday, June 10, 2009 22:57
Posted in category CURL PHP Examples
<?php
// Create a curl handle
$ch = curl_init('http://www.yahoo.com/');

// Execute
curl_exec($ch);

// Check if any error occured
if(!curl_errno($ch))
{
 $info = curl_getinfo($ch);

 echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
}

// Close handle
curl_close($ch);
?>
  • Share/Bookmark
You can leave a response, or trackback from your own site.

Leave a Reply