PHP 手机号中间4位加密
/**
* 中间加密 字符串截取法
*/
public static function encryptTel($tel) {
$new_tel = substr($tel, 0, 3).'****'.substr($tel, 7); return $new_tel;
} /**
* 中间加密 替换字符串的子串
*/
public static function encryptTel($tel) {
$new_tel = substr_replace($tel, '****', 3, 4); return $new_tel;
} /**
* 中间加密 用正则
*/
public static function encryptTel($tel) {
$new_tel = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $tel); return $new_tel;
}
本文链接:https://www.yun316.net/service/viewHelp/host-11.html复制链接
这篇文档是否对你有帮助?

马上开启灰狼云-Yun316云计算之旅

7000+用户的选择,100000+小时稳定运行

立即体验
咨询售后


·

在线客服
在线客服 QQ在线客服
咨询热线
咨询热线 13888888888