The use of

PHP mobile phone and email the user name to replace the asterisk in many activities such as the interface will see some Taobao shopping interface in the customer's payment but are hidden away Oh, here we look at the use of it..

 < PHP? Function hideStar ($str) {/ / username, email, mobile phone account center * string to hide if (strpos ($str, '@')) {$email_array = explode (@ $str); $prevfix = (strlen ($email_array[0]) < 4)? "": substr ($str, 0, 3); / / mailbox prefix $count = 0; $str = preg_replace ([dw+_-]{0100} / (@/'),'***@', $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; > < PHP?? $account = "phpfensi.com $email =" 416148489@ qq.com ";"; $phone = 18005152525; > < DOCTYPE?! HTML PUBLIC "-//W3C//DTD XHTML 1" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "Transitional//EN" > < HTML; xmlns= > http://www.w3.org/1999/xhtml & lt; head> < meta http-equiv= "Content-Type" content= "text/html; charset=utf-8 /> < title> presentation: PHP mobile phone and email user name with an asterisk hidden < /title> < meta name=" viewport "content=" width=device-width, initial-scale=1, maximum-scale=1 "/> link rel=" style; < Sheet "type=" text/css "rel=" external "/> nofollow < style type=" text/css "> < /style> < /head> < body> < div> < div> < UL id=" NAV "> < li> < a rel=" external nofollow rel= "" external nofollow "> /a> < page < /li> < li> < a rel= external" nofollow "> < /a> < template;; /li> < li> < a rel=" external nofollow ">"; < / a> effects; < /li> < li> < a rel= external "nofollow" > PHP< /a> < /li> < li> < a rel= "external nofollow" > /a> select < < /li> < /ul> < a rel= "external nofollow" rel= "external nofollow >"; < img src= "http://www.phpfensi.com /Public/images/logo.jpg" alt= "material fire logo" /> < /a> < /div> < /div> < div> < div> < h2> < a rel= > "external nofollow" tutorial: PHP, mobile phone and email user name Zim hidden < /a> < /h2> < table width= "100%" > < tr> < td> /td> < < number; td> /td> < E-mail: < td> < /td> mobile phone; < /tr> < tr> < td> < PHP echo $account;?? > < /td> < td> < PHP echo $email; >?? < /td> < td> PHP; < echo? $phone; > < /td>? < /tr> < ; tr> < td> < PHP? Echo hideStar ($account); > < /td>? < td> < PHP? Echo hideStar ($email); > < /td>? < td> < PHP? Echo hideStar ($phone); > <? /td> < /tr> < /table> < /div> < /div> < /body> < /html> 

"summarized above is Xiaobian to introduce the PHP using the asterisk is replaced by code name mobile phone and email, I hope all of you to help, if you have any questions please give me a message, Xiao Bian will reply you timely. Thank you for your support for the home website of the script!

you might be interested in this article:

  • PHP

mobile phone and email


This concludes the body part

This paper fixed link:http://www.script-home.com/php-uses-asterisk-to-replace-the-implementation-code-of-the-username-cell-phone-and-mailbox.html | Script Home | +Copy Link

Article reprint please specify:PHP uses asterisk to replace the implementation code of the username cell phone and mailbox | Script Home

You may also be interested in these articles!