php 检测敏感字
public function getMin($content){
//调用接口
$content_url ="http://www.ju1.cn/index.php/Index/add.html"; //curl post $content_arr = ['mgtype'=>1, 'mz_wj_type'=>1, 'ty_wj_type'=>1, 'text'=>$content, 'xw_wj_type'=>1]; $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_URL,$content_url);//抓取指定网页 curl_setopt($ch, CURLOPT_HEADER, 0);//设置header curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上 curl_setopt($ch, CURLOPT_POST, 1);//post提交方式 curl_setopt($ch, CURLOPT_POSTFIELDS, $content_arr); $pi_data = curl_exec($ch);//运行curl curl_close($ch); $str ="[{(.*)}]"; preg_match($str,$pi_data,$pre); if (!empty($pre[1])){ $pre = "[{".$pre[1]."}]"; return $pre;
}
return false;
}
敏感字,敏感字检测,php敏感字,php敏感字检测