注册送现金一元秒提现

  • <tr id='y26a4'><strong id='y26a4'></strong><small id='y26a4'></small><button id='y26a4'></button><li id='y26a4'><noscript id='y26a4'><big id='y26a4'></big><dt id='y26a4'></dt></noscript></li></tr><ol id='y26a4'><option id='y26a4'><table id='y26a4'><blockquote id='y26a4'><tbody id='y26a4'></tbody></blockquote></table></option></ol><u id='y26a4'></u><kbd id='y26a4'><kbd id='y26a4'></kbd></kbd>

    <code id='y26a4'><strong id='y26a4'></strong></code>

    <fieldset id='y26a4'></fieldset>
          <span id='y26a4'></span>

              <ins id='y26a4'></ins>
              <acronym id='y26a4'><em id='y26a4'></em><td id='y26a4'><div id='y26a4'></div></td></acronym><address id='y26a4'><big id='y26a4'><big id='y26a4'></big><legend id='y26a4'></legend></big></address>

              <i id='y26a4'><div id='y26a4'><ins id='y26a4'></ins></div></i>
              <i id='y26a4'></i>
            1. <dl id='y26a4'></dl>

                1. <form id='dt9tn'></form>
                    <bdo id='dt9tn'><sup id='dt9tn'><div id='dt9tn'><bdo id='dt9tn'></bdo></div></sup></bdo>

                      • 当前位置:首页 > PHP教程 > php函数 > 列表

                        PHP使用星号替代用户名手机和邮箱

                        发布:smiling 来源: PHP粉丝网  添加日期:2015-08-30 14:20:01 浏览: 评论:0 

                        注册送现金一元秒提现PHPSHIYONGXINGHAOTIDAIYONGHUMINGSHOUJIHEYOUXIANGZHEIGEZAIXUDUODEHUODONGJIEMIANHUIKANDAORUTAOBAODEGOUWUJIEMIANZHONGDEYIXIEKEHUDEZHIFUBAOHAODOUSHIYINZANGDIAODEE,XIAMIANWOMENLAIKANYIXIATADESHIYONGFANGFABA.

                        1. <?php 
                        2. function hideStar($str) { //用户名、邮箱、手机账号中间字符串以*隐藏 
                        3.     if (strpos($str'@')) { 
                        4.         $email_array = explode("@"$str); 
                        5.         $prevfix = (strlen($email_array[0]) < 4) ? "" : substr($str, 0, 3); //邮箱前缀 
                        6.         $count = 0; 
                        7.         $str = preg_replace('/([\d\w+_-]{0,100})@/''***@'$str, -1, $count); 
                        8.         $rs = $prevfix . $str
                        9.     } else { 
                        10.         $pattern = '/(1[3458]{1}[0-9])[0-9]{4}([0-9]{4})/i'
                        11.         if (preg_match($pattern$str)) { 
                        12.             $rs = preg_replace($pattern'$1****$2'$str); // substr_replace($name,'****',3,4); 
                        13.         } else { 
                        14.             $rs = substr($str, 0, 3) . "***" . substr($str, -1); 
                        15.         } 
                        16.     } 
                        17.     return $rs
                        18. ?> 
                        19. <?php 
                        20. $account = "mailanhe.com"
                        21. $email = ""
                        22. $phone = ""
                        23. ?> 
                        24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
                        25. <html xmlns="http://www.w3.org/1999/xhtml"
                        26.     <head>  
                        27.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
                        28.         <title>演示:PHP以星号隐藏用户名手机和邮箱</title> 
                        29.         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> 
                        30.         <link rel="stylesheet" type="text/css" href="http://mailanhe.com  /jquery/css/common.css" /> 
                        31.         <style type="text/css"
                        32.         </style> 
                        33.     </head> 
                        34.     <body> 
                        35.         <div class="head"
                        36.             <div class="head_inner clearfix"
                        37.                 <ul id="nav"
                        38.                     <li><a href="http://mailanhe.com  ">首 页</a></li> 
                        39.                     <li><a href="http://www.phpfensi.com  /templates">网站模板</a></li> 
                        40.                     <li><a href="http://mailanhe.com  /js">网页特效</a></li> 
                        41.                     <li><a href="http://mailanhe.com  /php">PHP</a></li> 
                        42.                     <li><a href="http://mailanhe.com  /site">精选网址</a></li> 
                        43.                 </ul> 
                        44.                 <a class="logo" href="http://mailanhe.com  "><img src="http://mailanhe.com  /Public/images/logo.jpg" alt="素材火logo" /></a> 
                        45.             </div> 
                        46.         </div> 
                        47.         <div class="container"
                        48.             <div class="demo"
                        49.                 <h2 class="title"><a href="http://mailanhe.com  /js/548.html">教程:PHP以星号隐藏用户名手机和邮箱</a></h2> 
                        50.                 <table width="100%" class="table_parameters"
                        51.                     <tr class="tr_head"
                        52.                         <td>账号</td> 
                        53.                         <td>邮箱</td> 
                        54.                         <td>手机</td> 
                        55.                     </tr> 
                        56.                     <tr> 
                        57.                         <td><?php echo $account; ?></td> 
                        58.                         <td><?php echo $email; ?></td> 
                        59.                         <td><?php echo $phone; ?></td> 
                        60.                     </tr> 
                        61.                     <tr class="red"
                        62.                         <td><?php echo hideStar($account); ?></td> 
                        63.                         <td><?php echo hideStar($email); ?></td> 
                        64.                         <td><?php echo hideStar($phone); ?></td> 
                        65.                     </tr> 
                        66.                 </table> 
                        67.             </div> 
                        68.         </div> 
                        69.         
                        70.     </body> 
                        71. </html> 

                        Tags: PHP星号 PHP用户名 PHP邮箱

                        分享到:

                        靠谱的棋牌---首页_Welcome 蓝洞棋牌官网送3金币---首页_Welcome 百灵拼三张-Welcome 聚友棋牌官网下载安装-首页 百胜棋牌---首页_欢迎您