Documentation for curl_strerror

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330506 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Scheller 2013-06-15 13:03:33 +00:00
parent 4935e95ad9
commit 288705b80e

View file

@ -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