手记

php curl使用

$cu = curl_init();

curl_setopt($cu, CURLOPT_RETURNTRANSFER, true);

curl_setopt($cu, CURLOPT_TIMEOUT, 5);

curl_setopt($cu, CURLOPT_URL, '****');

$c = curl_exec($cu);

$info = curl_getinfo($cu);

print $info['http_code'];


0人推荐
随时随地看视频
慕课网APP