2004-05-02 15:46:36 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2007-06-20 22:25:43 +00:00
|
|
|
<!-- $Revision: 1.7 $ -->
|
|
|
|
<refentry xml:id="function.curl-copy-handle" xmlns="http://docbook.org/ns/docbook">
|
2004-05-02 15:46:36 +00:00
|
|
|
<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>
|
2007-01-17 00:14:52 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2004-05-02 15:46:36 +00:00
|
|
|
<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>
|
2007-01-17 00:14:52 +00:00
|
|
|
Copies a cURL handle keeping the same preferences.
|
2005-06-15 22:15:55 +00:00
|
|
|
</para>
|
2007-01-17 00:14:52 +00:00
|
|
|
</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;
|
2005-06-15 22:15:55 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
2007-01-17 00:14:52 +00:00
|
|
|
<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
|
2007-01-17 00:14:52 +00:00
|
|
|
// create a new cURL resource
|
2005-06-15 22:15:55 +00:00
|
|
|
$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);
|
|
|
|
|
2007-01-17 00:14:52 +00:00
|
|
|
// close cURL resources, and free up system resources
|
2005-06-15 22:15:55 +00:00
|
|
|
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
|
|
|
|
-->
|