svn: /phpdoc/en/trunk/reference/curl/functions/ curl-strerror.xml

From: Date: Sat, 15 Jun 2013 13:03:33 +0000
Subject: svn: /phpdoc/en/trunk/reference/curl/functions/ curl-strerror.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-11385@lists.php.net to get a copy of this message
kazymjir Sat, 15 Jun 2013 13:03:33 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=330506 Log: Documentation for curl_strerror Changed paths: U phpdoc/en/trunk/reference/curl/functions/curl-strerror.xml Modified: phpdoc/en/trunk/reference/curl/functions/curl-strerror.xml =================================================================== --- phpdoc/en/trunk/reference/curl/functions/curl-strerror.xml 2013-06-15 13:02:31 UTC (rev 330505) +++ phpdoc/en/trunk/reference/curl/functions/curl-strerror.xml 2013-06-15 13:03:33 UTC (rev 330506) @@ -4,7 +4,7 @@ <refentry xml:id="function.curl-strerror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>curl_strerror</refname> - <refpurpose>Return string describing error code</refpurpose> + <refpurpose>Return string describing the given error code</refpurpose> </refnamediv> <refsect1 role="description"> @@ -14,11 +14,9 @@ <methodparam><type>int</type><parameter>errornum</parameter></methodparam> </methodsynopsis> <para> - + Returns a text error message describing the given error code. </para> - &warn.undocumented.func; - </refsect1> <refsect1 role="parameters"> @@ -28,7 +26,7 @@ <term><parameter>errornum</parameter></term> <listitem> <para> - One of <constant>CURLE_*</constant> constants. + One of the <link xlink:href="&url.curl.error;">cURL error codes</link> constants. </para> </listitem> </varlistentry> @@ -42,6 +40,53 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>curl_errno</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Create a curl handle with a mispelled protocol in URL +$ch = curl_init("htp://example.com/"); + +// Send request +curl_exec($ch); + +// Check for errors and display the error message +if($errno = curl_errno($ch)) { + $error_message = curl_strerror($errno); + echo "cURL error ({$errno}):\n {$error_message}"; +} + +// Close the handle +curl_close($ch); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +cURL error (1): + Unsupported protocol +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_errno</function></member> + <member><function>curl_error</function></member> + <member><link xlink:href="&url.curl.error;">Curl error codes</link></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file

« previous php.doc.cvs (#11385) next »