Hello Mailing List,
This is my first contribution for the documentation project. I would ask
you to review my patch and give me some tips for the future.
The patch is for curl function curl_escape, located in
/en/reference/curl/functions/.
Using an occasion I would to ask a question - in the future should I
divide patches into separate emails or rather put them into a single email?
Best regards,
Adam
Index: curl-escape.xml
===================================================================
--- curl-escape.xml (revision 330473)
+++ curl-escape.xml (working copy)
@@ -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