Phpcurl_init and curl_setopt functions _ PHP Tutorial

Source: Internet
Author: User
Phpcurl_init and curl_setopt functions. Phpcurl_init and curl_setopt functions curl_init (4.0.2 in PHP4, PHP5) curl_init-initialize a curl meeting description resource curl_init ([String $ URL 0 value]) initial php curl_init and curl_setopt functions

Curl_init
("= 4.0.2, PHP 5" in PHP 4)

Curl_init-initialize a curl meeting

Description
Resource curl_init ([String $ url = zero value])
Initialize a new meeting and return a curl processing for the curl_setopt (), curl_exec (), and curl_close () functions.

Parameters

URL
If provided, the CURLOPT_URL option will be set to its value. You can manually use the curl_setopt () function.


Return value
Returns a successful, false error.

Instance

For example, #1 initializes a new curly meeting and obtains a webpage.

// Create a new cURL resource
$ Ch = curl_init ();

// Set URL and other appropriate options
Curl_setopt ($ ch, CURLOPT_URL, "http://www.111cn.cn /");
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 );
?>


Http://www.bkjia.com/PHPjc/445456.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445456.htmlTechArticlephp curl_init and curl_setopt functions curl_init (PHP 4 = 4.0.2, PHP 5) curl_init-initialize a curl meeting description resource curl_init ([String $ url = 0 value]) initial...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.