<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <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 the given error code</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>curl_strerror</methodname> <methodparam><type>int</type><parameter>errornum</parameter></methodparam> </methodsynopsis> <para> Returns a text error message describing the given error code. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <variablelist> <varlistentry> <term><parameter>errornum</parameter></term> <listitem> <para> One of the <link xlink:href="&url.curl.error;">cURL error codes</link> constants. </para> </listitem> </varlistentry> </variablelist> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns error description or &null; for invalid error code. </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 Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->