Answers
1.打开curl扩展
2.注意是不是https
3.curl_setopt($ch, CURLOPT_POST, 1),是标识post数据过去
下边是代码:
set_time_limit(120);
$ch = curl_init($curl) ;
if($method == 'post'){
curl_setopt($ch, CURLOPT_POST, 1);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
$output = curl_exec($ch) ;
你好我叫大表哥
answered 11 years ago