明霞山资源网 Design By www.htccd.com
PHP使用星号替代用户名手机和邮箱这个在许多的活动界面会看到如淘宝的购物界面中的一些客户的支付宝号都是隐藏掉的哦,下面我们来看一下它的使用方法吧.
<"@", $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;
}
"phpfensi.com";
$email = "416148489@qq.com";
$phone = "18005152525";
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>演示:PHP以星号隐藏用户名手机和邮箱</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="stylesheet" type="text/css" href="http://www.phpfensi.com /jquery/css/common.css" rel="external nofollow" />
<style type="text/css">
</style>
</head>
<body>
<div class="head">
<div class="head_inner clearfix">
<ul id="nav">
<li><a href="http://www.phpfensi.com " rel="external nofollow" rel="external nofollow" >首 页</a></li>
<li><a href="http://www.phpfensi.com /templates" rel="external nofollow" >网站模板</a></li>
<li><a href="http://www.phpfensi.com /js" rel="external nofollow" >网页特效</a></li>
<li><a href="http://www.phpfensi.com /php" rel="external nofollow" >PHP</a></li>
<li><a href="http://www.phpfensi.com /site" rel="external nofollow" >精选网址</a></li>
</ul>
<a class="logo" href="http://www.phpfensi.com " rel="external nofollow" rel="external nofollow" ><img src="/UploadFiles/2021-04-02/logo.jpg">总结
以上所述是小编给大家介绍的PHP使用星号替代用户名手机和邮箱的实现代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
标签:
php,用户名替换成星号
明霞山资源网 Design By www.htccd.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
明霞山资源网 Design By www.htccd.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。