5
5
<refname >curl_init</refname >
6
6
<refpurpose >Initialize a cURL session</refpurpose >
7
7
</refnamediv >
8
-
8
+
9
9
<refsect1 role =" description" >
10
10
&reftitle.description;
11
11
<methodsynopsis >
12
12
<type class =" union" ><type >CurlHandle</type ><type >false</type ></type ><methodname >curl_init</methodname >
13
13
<methodparam choice =" opt" ><type class =" union" ><type >string</type ><type >null</type ></type ><parameter >url</parameter ><initializer >&null; </initializer ></methodparam >
14
14
</methodsynopsis >
15
15
<para >
16
- Initializes a new session and return a cURL handle for use with the
17
- <function >curl_setopt</function >, <function >curl_exec</function >,
18
- and <function >curl_close</function > functions.
16
+ Initializes a new session and returns a cURL handle.
19
17
</para >
20
18
</refsect1 >
21
19
28
26
<listitem >
29
27
<para >
30
28
If provided, the <constant >CURLOPT_URL</constant > option will be set
31
- to its value. You can manually set this using the
29
+ to its value. This can be set manually using the
32
30
<function >curl_setopt</function > function.
33
31
</para >
34
32
<note >
49
47
Returns a cURL handle on success, &false; on errors.
50
48
</para >
51
49
</refsect1 >
52
-
50
+
53
51
<refsect1 role =" changelog" >
54
52
&reftitle.changelog;
55
53
<informaltable >
89
87
<programlisting role =" php" >
90
88
<![CDATA[
91
89
<?php
92
- // create a new cURL resource
90
+
91
+ // Initializes a new cURL session
93
92
$ch = curl_init();
94
93
95
- // set URL and other appropriate options
94
+ // Set URL and other appropriate options
96
95
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
97
96
curl_setopt($ch, CURLOPT_HEADER, 0);
98
97
99
- // grab URL and pass it to the browser
98
+ // Grab URL and pass it to the browser
100
99
curl_exec($ch);
101
100
102
- // close cURL resource, and free up system resources
103
- curl_close($ch);
104
101
?>
105
102
]]>
106
103
</programlisting >
@@ -112,7 +109,6 @@ curl_close($ch);
112
109
&reftitle.seealso;
113
110
<para >
114
111
<simplelist >
115
- <member ><function >curl_close</function ></member >
116
112
<member ><function >curl_multi_init</function ></member >
117
113
</simplelist >
118
114
</para >
0 commit comments