$token = $this->token();
$url = "https://api.weixin.qq.com/wxa/img_sec_check?access_token=".$token;
$file_data = array("media"=>new \CURLFile($imgUrl));//$content(需要检测的文本内容,最大520KB)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);//地址
curl_setopt($ch , CURLOPT_RETURNTRANSFER, 1);//设置头
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);//取消验证
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch , CURLOPT_POST, 1);//post
@curl_setopt($ch, CURLOPT_POSTFIELDS, $file_data);//参数
$output = curl_exec($ch);//发送请求获取结果
curl_close($ch);//关闭会话
$res = json_decode($output,true);
if($res["errcode"] != 0){
$dat = ["resultCode"=>$res,"resultMsg"=>"内容含有违法违规内容"];
}else{
$dat = ["resultCode"=>$res,"resultMsg"=>"ok"];
}
return $dat;
返回的是个空,我的php版本是5.6.8,如果不用new \CURLFile 就返回41005
敢问楼主怎么解决的?我现在接口返回false
已经解决
2个参数,还少个access_token