Blogger Information
Blog 14
fans 0
comment 0
visits 15034
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
CURL发送HTTP请求
krasenChen的博客
Original
1118 people have browsed it

//1.初始化连接句柄

$ch = curl_init();

//2.设置选项, 包括URL

curl_setopt($ch, CURLOPT_URL, "http://www.test.com");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_HEADER, 0);

//3.执行并获取HTML文档内容

$output = curl_exec($ch);

if($outpub === false) {

    echo "CURL Error:".curl_error($ch);

}

//4.释放curl连接句柄

curl_close($ch);


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post