發(fā)表日期:2019-09 文章編輯:小燈 瀏覽次數(shù):3323
//用戶名、郵箱、手機(jī)賬號(hào)中間字符串以*隱藏 function xhdestar($str) { if (strpos($str, '@')) { $email_array = explode("@", $str); $prevfix = (strlen($email_array[0]) < 4) ? "" : substr($str, 0, 3); //郵箱前綴 $count = 0; $str = preg_replace('/([\d\w+_-]{0,100})@/', '***@', $str, -1, $count); $rs = $prevfix . $str; } else { $pattern = '/(1[3458]{1}[0-9])[0-9]{4}([0-9]{4})/i'; if (preg_match($pattern, $str)) { $rs = preg_replace($pattern, '$1****$2', $str); // substr_replace($name,'****',3,4); } else { $rs = substr($str, 0, 3) . "***" . substr($str, -1); } } return $rs; }
實(shí)例用法:chip/contact.htm中調(diào)用
{xhdestar($member[mobile])}10
日期:2019-09 瀏覽次數(shù):3910
日期:2019-09 瀏覽次數(shù):3698
日期:2019-09 瀏覽次數(shù):3697
日期:2019-09 瀏覽次數(shù):3611
日期:2019-09 瀏覽次數(shù):3610
日期:2019-09 瀏覽次數(shù):3613
日期:2019-09 瀏覽次數(shù):3657
日期:2019-09 瀏覽次數(shù):3712
日期:2019-09 瀏覽次數(shù):4042
日期:2019-09 瀏覽次數(shù):3532
日期:2019-09 瀏覽次數(shù):3619
日期:2019-09 瀏覽次數(shù):3311
日期:2019-09 瀏覽次數(shù):3322
日期:2019-09 瀏覽次數(shù):2994
日期:2019-09 瀏覽次數(shù):3031
日期:2019-09 瀏覽次數(shù):3013
日期:2019-09 瀏覽次數(shù):2998
日期:2019-09 瀏覽次數(shù):3119
日期:2019-09 瀏覽次數(shù):3065
日期:2019-09 瀏覽次數(shù):3266
日期:2019-09 瀏覽次數(shù):3154
日期:2019-09 瀏覽次數(shù):3337
日期:2019-09 瀏覽次數(shù):3050
日期:2019-09 瀏覽次數(shù):3387
日期:2019-09 瀏覽次數(shù):3252
日期:2019-09 瀏覽次數(shù):3246
日期:2019-09 瀏覽次數(shù):3127
日期:2019-09 瀏覽次數(shù):3164
日期:2019-09 瀏覽次數(shù):3024
日期:2019-09 瀏覽次數(shù):2970
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.