
具体代码如下:
function hidePhoneNumber($phoneNumber) {
$result = "";
//判断手机号是否正确
if(preg_match("/1\d{10}/", $phoneNumber)){
//使用substr_replace将中间四位替换为*
$result = substr_replace($phoneNumber, '****', 3, 4);
}
return $result;
}
上面是“php如何实现手机号脱敏(隐藏手机号中间4位)”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_3925.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

jquery哪些版本可以兼容IE8