php-doc-en/reference/curl/functions/curl-copy-handle.xml
2011-08-16 11:38:58 +00:00

87 lines
1.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.curl-copy-handle" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>curl_copy_handle</refname>
<refpurpose>Copy a cURL handle along with all of its preferences</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>curl_copy_handle</methodname>
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
</methodsynopsis>
<para>
Copies a cURL handle keeping the same preferences.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&curl.ch.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new cURL handle.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Copying a cURL handle</title>
<programlisting role="php">
<![CDATA[
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);
// copy the handle
$ch2 = curl_copy_handle($ch);
// grab URL (http://www.example.com/) and pass it to the browser
curl_exec($ch2);
// close cURL resources, and free up system resources
curl_close($ch2);
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->