Document curl_escape(), patch by Adam Kazimierczak: kazymjir@ gmail

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330474 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hannes Magnusson 2013-06-10 22:05:53 +00:00
parent f2a0c0ffd9
commit 460373cf01

View file

@ -15,11 +15,9 @@
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
This function URL encodes the given string according to <link xlink:href="&url.rfc;3986">RFC 3986</link>.
</para>
&warn.undocumented.func;
</refsect1>
<refsect1 role="parameters">
@ -30,7 +28,7 @@
<term><parameter>str</parameter></term>
<listitem>
<para>
The string to be encoded.
</para>
</listitem>
</varlistentry>
@ -44,6 +42,49 @@
</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();
// Escape a string used as a GET parameter
$location = curl_escape($ch, 'Hofbräuhaus / München');
// Result: Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen
// Compose an URL with the escaped string
$url = "http://example.com/add_location.php?location={$location}";
// Result: http://example.com/add_location.php?location=Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen
// Send HTTP request and close the handle
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>curl_unescape</function></member>
<member><function>urlencode</function></member>
<member><function>rawurlencode</function></member>
<member><link xlink:href="&url.rfc;3986">RFC 3986</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file