- /**
- * 内容安全检查
- */
- public function msgSecCheck($content){
- $token = $this->getAccessToken();
- $url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=$token";
- $data='{ "content":"'.$content.'" }';
- $info = $this->httpPost($url,$data);
- return json_decode($info,true);
- }
- /**
- * http post 请求
- */
- function httpPost($url,$data='') {
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_TIMEOUT, 500);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_POST, TRUE);
- curl_setopt($curl, CURLOPT_POSTFIELDS,$data);
- $res = curl_exec($curl);
- curl_close($curl);
- return $res;
- }