/**
* 手机号码替换
*/
function vaildTel($s)
{
preg_match_all("/15[0-9]\d{8}|17[0-9]\d{8}|14[0-9]\d{8}|13[0-9]\d{8}|18[0-9]\d{8}/", $s, $arr);
foreach ($arr[0] as $tel) {
$new = substr($tel, 0, 3) . '****' . substr($tel, 7, strlen($tel));
$s = str_replace($tel, $new, $s);
}
$s = preg_replace("#(\w+)\\.COM#i", "******.com", $s);
$s = preg_replace("#(\w+)\\.CN#i", "******.cn", $s);
return preg_replace("#(\w+)\\.COM.CN#i", "******.cn", $s);
}
/*网址号码过滤*/
$content = vaildTel($content);
07-02
3633
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)