svn: /phpdoc/en/trunk/reference/curl/functions/ curl-reset.xml

From: Date: Sat, 15 Jun 2013 13:03:44 +0000
Subject: svn: /phpdoc/en/trunk/reference/curl/functions/ curl-reset.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-11386@lists.php.net to get a copy of this message
kazymjir Sat, 15 Jun 2013 13:03:44 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=330507 Log: Documentation for curl_reset Changed paths: U phpdoc/en/trunk/reference/curl/functions/curl-reset.xml Modified: phpdoc/en/trunk/reference/curl/functions/curl-reset.xml =================================================================== --- phpdoc/en/trunk/reference/curl/functions/curl-reset.xml 2013-06-15 13:03:33 UTC (rev 330506) +++ phpdoc/en/trunk/reference/curl/functions/curl-reset.xml 2013-06-15 13:03:44 UTC (rev 330507) @@ -14,11 +14,9 @@ <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - + This function re-initializes all options set on the given cURL handle to the default values. </para> - &warn.undocumented.func; - </refsect1> <refsect1 role="parameters"> @@ -35,6 +33,54 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>curl_reset</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Create a curl handle +$ch = curl_init(); + +// Set CURLOPT_USERAGENT option +curl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent"); + +// Reset all previously set options +curl_reset($ch); + +// Send HTTP request +curl_setopt($ch, CURLOPT_URL, 'http://example.com/'); +curl_exec($ch); // the previously set user-agent will be not sent, it has been reset by curl_reset + +// Close the handle +curl_close($ch); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + <function>curl_reset</function> also resets the URL given as the <function>curl_init</function> parameter. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_setopt</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file

« previous php.doc.cvs (#11386) next »