Heim  >  Artikel  >  php教程  >  php curl_init 与 curl_setopt函数

php curl_init 与 curl_setopt函数

WBOY
WBOYOriginal
2016-06-13 11:17:241543Durchsuche

php curl_init 与 curl_setopt函数  

curl_init
( PHP 4中“ = 4.0.2 , PHP 5中)

curl_init -初始化一个卷曲会议

描述
资源curl_init ( [字符串$网址=零值] )
初始化一个新的会议,并返回一个卷曲处理用于curl_setopt ( ) , curl_exec ( ) ,和curl_close ( )函数。

参数

网址
如果提供, CURLOPT_URL选项将被设置为它的价值。您可以手动设置使用curl_setopt ( )函数。


返回值
返回一个卷曲处理的成功,虚假的错误。

实例

例如# 1初始化一个新的卷曲会议和获取一个网页

// 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);
?>


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php filegroup 函数Nächster Artikel:php fgetcsv 函数