思路
下面是PHP代碼
function shorturl($url=
$base
$hex = md
$hexLen = strlen($hex)
$subHexLen = $hexLen /
$output = array()
for ($i =
$subHex = substr ($hex
$int =
$out =
for ($j =
$val =
$out
$int = $int >>
}
$output[] = $out
}
return $output
}
$urls = shorturl(
var_dump($urls)
From:http://tw.wingwit.com/Article/program/PHP/201311/20962.html