(PHP 4 >= 4.0.4, PHP 5)
curl_getinfo — Get information regarding a specific transfer
A cURL handle returned by curl_init().
This may be one of the following constants:
If opt is given, returns its value as a string. Otherwise, returns an associative array with the following elements (which correspond to opt ):
Example #1 curl_getinfo() example
<?php
// Create a curl handle to a non-existing location
$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);
?>