php隐藏手机号中间四位的方法:1、字符串截取法【$new_tel1=substr($tel, 0, 3).'****'.substr($tel, 7)】;2、替换字符串的子串【$new_tel=substr_replace($tel)】。

【相关学习推荐:php编程(视频)】
php隐藏手机号中间四位的方法:
$num = "12345678910" $str = substr_replace($num,'****',3,4);

三种实现方式
立即学习“PHP免费学习笔记(深入)”;
结果:
> string(11) "123****8910" > string(11) "123****8910" > string(11) "123****8910"
想了解更多编程学习,敬请关注php培训栏目!











