2004-05-02 15:46:36 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2007-01-16 20:18:05 +00:00
|
|
|
<!-- $Revision: 1.5 $ -->
|
2004-05-02 15:46:36 +00:00
|
|
|
<refentry id="function.curl-copy-handle">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>curl_copy_handle</refname>
|
2007-01-16 20:18:05 +00:00
|
|
|
<refpurpose>Copy a cURL handle along with all of its preferences</refpurpose>
|
2004-05-02 15:46:36 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>resource</type><methodname>curl_copy_handle</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2005-06-15 22:15:55 +00:00
|
|
|
<para>
|
2005-06-16 08:52:00 +00:00
|
|
|
This function copies a cURL handle, returning a new cURL handle
|
|
|
|
with the same preferences.
|
2005-06-15 22:15:55 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Copying a cURL handle.</title>
|
2005-06-16 07:19:26 +00:00
|
|
|
<programlisting role="php">
|
2005-06-15 22:15:55 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
// create a new curl resource
|
|
|
|
$ch = curl_init();
|
2004-05-02 15:46:36 +00:00
|
|
|
|
2005-06-15 22:15:55 +00:00
|
|
|
// set URL and other appropriate options
|
|
|
|
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
2004-05-02 15:46:36 +00:00
|
|
|
|
2005-06-15 22:15:55 +00:00
|
|
|
// 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);
|
|
|
|
?>
|
|
|
|
]]>
|
2005-06-16 07:19:26 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2004-05-02 15:46:36 +00:00
|
|
|
</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:"../../../../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
|
|
|
|
-->
|