<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ <?php /** * ======================================= * Created by Zhihua_W. * Author: Zhihua_W * Date: 2016/12/1 0004 * Time: 下午 5:15 * Project: PHP開發小技巧 * Power: 兩種方法實現獲取隨機字符串 * ======================================= */ /** * 方法一:獲取隨機字符串 * @param number $length 長度 * @param string $type 類型 * @param number $convert 轉換大小寫 * @return string 隨機字符串 */ function random($length = 6, $type = 'string', $convert = 0) { $config = array( 'number' => '1234567890', 'letter' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'string' => 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789', 'all' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' ); if (!isset($config[$type])) $type = 'string'; $string = $config[$type]; $code = ''; $strlen = strlen($string) - 1; for ($i = 0; $i < $length; $i++) { $code .= $string{mt_rand(0, $strlen)}; } if (!empty($convert)) { $code = ($convert > 0) ? strtoupper($code) : strtolower($code); } return $code; } /** * 方法二:獲取隨機字符串 * @param int $randLength 長度 * @param int $addtime 是否加入當前時間戳 * @param int $includenumber 是否包含數字 * @return string */ function rand_str($randLength = 6, $addtime = 1, $includenumber = 0) { if ($includenumber) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQEST123456789'; } else { $chars = 'abcdefghijklmnopqrstuvwxyz'; } $len = strlen($chars); $randStr = ''; for ($i = 0; $i < $randLength; $i++) { $randStr .= $chars[rand(0, $len - 1)]; } $tokenvalue = $randStr; if ($addtime) { $tokenvalue = $randStr . time(); } return $tokenvalue; } //其中也可以放多個參數 //random(4,'number'); //random(6,'letter',1); echo random(10); //方法二同樣 echo rand_str(6); ?> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看