php-doc-en/reference/curl/functions/curl-exec.xml
Sean Coates 0599711bd1 Added examples (from curl-init)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152512 c90b9560-bf6c-de11-be94-00142212c4b1
2004-02-27 05:38:35 +00:00

73 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/curl.xml, last change in rev 1.1 -->
<refentry id="function.curl-exec">
<refnamediv>
<refname>curl_exec</refname>
<refpurpose>Perform a CURL session</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>curl_exec</methodname>
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
</methodsynopsis>
<para>
This function should be called after you initialize a CURL
session and all the options for the session are set. Its purpose
is simply to execute the predefined CURL session (given by the
<parameter>ch</parameter>).
<example>
<title>
Initializing a new CURL session and fetching a webpage
</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);
// grab URL and pass it to the browser
curl_exec($ch);
// close curl resource, and free up system resources
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
If you want to have the result returned instead of it being printed to the
browser directly, use the CURLOPT_RETURNTRANSFER option of
<function>curl_setopt</function>.
</para>
</note>
</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
-->