Home >Backend Development >PHP Tutorial >PHP4用户手册:函数-CRUL-curl_init_PHP

PHP4用户手册:函数-CRUL-curl_init_PHP

WBOY
WBOYOriginal
2016-06-01 12:39:00770browse

手册

H1>

(PHP 4 >= 4.0.2)

curl_init -- 初始化一个CURL会话

描述

 

int curl_init ([string url])

 

curl_init()函数将初始化一个新的会话,返回一个CURL句柄供curl_setopt(), curl_exec(),和 curl_close() 函数使用。如果可选参数被提供,那么CURLOPT_URL选项将被设置成这个参数的值。你可以使用curl_setopt()函数人工设置。
例 1. 初始化一个新的CURL会话,且取回一个网页

$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "http://www.zend.com/");
curl_setopt ($ch, CURLOPT_HEADER, 0);

curl_exec ($ch);

curl_close ($ch);
?>
 


参见:curl_close(), curl_setopt()

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php.ini_PHPNext article:PHP4用户手册:函数-fwrite_PHP