- <?php
- function base62($x)
- {
- $show = '';
- while($x > 0) {
- $s = $x % 62;
- if ($s > 35) {
- $s = chr($s 61);
- } elseif ($s > 9 && $s <=35) {
- $s = chr($s 55);
- }
- $show .= $s;
- $x = floor($x/62);
- }
- return $show;
- }
-
- function urlShort($url)
- {
- $url = crc32($url);
- $result = sprintf("%u", $url);
- return base62($result);
- }
-
- echo urlShort("http://code.google.com/p/rfphp4zf");
來源于申明:以上內(nèi)容一部分(包括照片、文本)來自互聯(lián)網(wǎng),若有侵權(quán)行為,請立即與本網(wǎng)站聯(lián)絡(luò)(010-57218159)。
如沒特殊注明,文章均為酷站科技原創(chuàng),轉(zhuǎn)載請注明來自http://www.cneiwo.cn/jianzhanzhishi/4358.html
聯(lián)系專業(yè)的商務(wù)顧問,制定方案,專業(yè)設(shè)計,一對一咨詢及其報價詳情
服務(wù)熱線
18911184380