抖音今日头条小程序内容安全检测php代码(已测试)

function curlRequest($url,$mothed, $contentbody,$access_token)
{
$ch = curl_init();
$header = "Accept-Charset: utf-8";
$header = "Content-Type:application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Token: '.$access_token.''));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $mothed);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $contentbody);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$temp = curl_exec($ch);
curl_close($ch);
return $temp;
}
 
 
 
$contentbody = '{"tasks": [{"content": "'.$content.'"}]}';
        $url = "https://developer.toutiao.com/api/v2/tags/text/antidirt";
        $respon = curlRequest($url,'POST',$contentbody,$access_token);
        $respons = json_decode($respon,true);
 

有好的文章希望林羽凡帮助分享和推广,猛戳这里我要分享

作者:林羽凡
生活只有在平淡无味的人看来才是空虚而平淡无味的。-- 车尔尼雪夫斯基
返回列表
上一篇: