MENU

微信文本安全检测php源码

January 22, 2020 • php

function curlText($test_word,$wx_token){
    $url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=".$wx_token;
    $file_data = '{ "content":"'.$test_word.'" }';//$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);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $file_data);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}
转载请注明出处,并添加原文地址

Archives QR Code Tip
QR Code for this page
Tipping QR Code