Php 如何隐藏部分电子邮件地址
大家早上好!我需要从数据库中获取一封电子邮件,但我想这样显示:Php 如何隐藏部分电子邮件地址,php,mysql,Php,Mysql,大家早上好!我需要从数据库中获取一封电子邮件,但我想这样显示: some******@hotmail.com 我想先显示我电子邮件的开头,然后再显示@之后的所有内容 我正在使用以下代码: $user_email= "********".substr($linha3['user_email'], -8); 它工作正常,但有时看起来不太好: *******mail.com 你能帮我解决吗?$email=$linha3['user\u email'] $email=substr($email,0,3
some******@hotmail.com
我想先显示我电子邮件的开头,然后再显示@之后的所有内容
我正在使用以下代码:
$user_email= "********".substr($linha3['user_email'], -8);
它工作正常,但有时看起来不太好:
*******mail.com
你能帮我解决吗?
$email=$linha3['user\u email']代码>
$email=substr($email,0,3)。'***'.substr($email,strpos($email,“@”)代码>$email=$linha3['user_email']代码>
$email=substr($email,0,3)。'***'.substr($email,strpos($email,“@”)代码>使用正则表达式始终匹配电子邮件用户名:
echo preg_替换('/.@/','***@',一些_mail@somewhere.net');
使用正则表达式始终匹配电子邮件用户名:
echo preg_替换('/.@/','***@',一些_mail@somewhere.net');
谢谢!它工作得很好!:)谢谢它工作得很好!:)