<?php
int curl_errno(CurlHandle $handle);
where,
$handle = The cURL handle returned by curl_init function
?>
<?php
// Create a curl handle to a non-existing location
$ch = curl_init('http://404.php.net/');
// Execute
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
// Check if any error occurred
if(curl_errno($ch))
{
echo 'Curl error: ' . curl_errno($ch);
}
// Close handle
curl_close($ch);
?>