(PHP 4 >= 4.0.3, PHP 5)
curl_errno — Returns the last error number
int curl_errno ( resource $ch )
Returns the error number of the last cURL operation.
ch
The cURL handle returned by curl_init().
Returns an error number or 0 (zero) if no error occurred.
<?php// Create a cURL handle pointing to a non-existent location $ch = curl_init('http://404.php.net/');// Execute curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec( $ch);// Check if an error occurs if(curl_errno($ch)){ echo 'Curl error: ' . curl_error($ch);}//Close the handle curl_close($ch);?>
curl_error() - Returns a string protecting the most recent error for the current session
» Curl error number