之前写过一篇过滤敏感词汇的文章,但是最近临近国庆,小程序提高了安全能力得检测,审核变得更加严格,要求自定义昵称、头像、签名等必须要有过滤敏感词汇得机制,严格上之前那边文章也可以过滤,但是具体微信过滤得内容就不得而知了,所以,今天就分享一下PHP利用微信小程序的API过滤一下敏感词汇。。🐶🐶🐶$appid = 'xxxxxx';
$appsecret = 'xxxxxx';
$msg_content = 'xxxxxxx';
//获取access_token
$access_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$appsecret;
$html = file_get_contents($access_url);
$output = json_decode($html, true);
$access_token = $output['access_token'];
$url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=".$acces