Documentation for curl_unescape

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

View file

@ -4,7 +4,7 @@
<refentry xml:id="function.curl-unescape" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>curl_unescape</refname>
<refpurpose>URL decodes the given string</refpurpose>
<refpurpose>Decodes the given URL encoded string</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,11 +15,8 @@
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
This function decodes the given URL encoded string.
</para>
&warn.undocumented.func;
</refsect1>
<refsect1 role="parameters">
@ -30,7 +27,7 @@
<term><parameter>str</parameter></term>
<listitem>
<para>
The URL encoded string to be decoded.
</para>
</listitem>
</varlistentry>
@ -40,7 +37,61 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Return unescaped string&return.falseforfailure;.
Returns decoded string &return.falseforfailure;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>curl_escape</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Create a curl handle
$ch = curl_init('http://example.com/redirect.php');
// Send HTTP request and follow redirections
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($ch);
// Get the last effective URL
$effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
// ie. "http://example.com/show_location.php?loc=M%C3%BCnchen"
// Decode the URL
$effective_url_decoded = curl_unescape($ch, $effective_url);
// "http://example.com/show_location.php?loc=München"
// Close the handle
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
<function>curl_unescape</function> does not decode plus symbols (+) into spaces. <function>urldecode</function> does.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>curl_escape</function></member>
<member><function>urlencode</function></member>
<member><function>urldecode</function></member>
<member><function>rawurlencode</function></member>
<member><function>rawurldecode</function></member>
</simplelist>
</para>
</refsect1>