我在变量中有一个联系号码,我想在php中隐藏总和数字。
喜欢: -
$contact=9899784414
;
$email= 'divakar.kumar6@gmail.com';
预期结果:98XXXXXX14
divaxxxxxxxxxx@gmail.com
答案 0 :(得分:1)
试试这个,
$email = 'divakar.kumar6@gmail.com';
$email = substr_replace($email,"xxxxxxxxxx",3,10);
$contact = "9899784414";
$contact = substr_replace($contact,"xxxxxx",2,6);
echo $email;
echo "<br/>";
echo $contact;