PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

curl_exec> <curl_errno
Last updated: Fri, 21 Nov 2008

view this page in

curl_error

(PHP 4 >= 4.0.3, PHP 5)

curl_errorRetorna uma string contendo o último erro da sessão atual

Descrição

string curl_error ( resource $ch )

Retorna uma mensagem de erro para a última operação cURL.

Parâmetros

ch

Um manipulador cURL retornado por curl_init().

Valor Retornado

Retorna a mensagem de erro ou '' (a string vazia) se nenhum erro ocorreu.

Exemplos

Exemplo #1 Exemplo da curl_error()

<?php
// Cria um handle para uma url inválida
$ch curl_init('http://404.php.net/');
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);

if(
curl_exec($ch) === false)
{
    echo 
'Curl error: ' curl_error($ch);
}
else
{
    echo 
'Operation completed without any errors';
}

// Fecha o handle
curl_close($ch);
?>



add a note add a note User Contributed Notes
curl_error
noah dot figg at xpertimage dot com
13-Mar-2008 03:06
The return value for this function is actually an english description of the error, rather than an error number, FYI.

curl_exec> <curl_errno
Last updated: Fri, 21 Nov 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites