/**
* 短域名生成&解析類
*/
class Build_URL {
private $mem;
private $base_url =
public function __construct() {
$mem_conf = array(
array(
)
array(
)
);
$this
foreach ($mem_conf as $v) {
$this
}
}
public function encode($url) {
$url = trim($url);
if(!preg_match("#^[http://|https://|ftp://]#iS"
return false;
}
$md
$aid = $this
if(!$aid) {
if(($aid = $this
$this
$aid = $this
}
$this
$key = $this
$this
} else {
$key = $this
}
return $this
}
public function decode($url) {
$key = str_replace($this
return $this
}
private function dec
$out =
if (! $base ) {
$base = strlen($index);
} else if (! $index ) {
$index = substr("
}
$t = ($num ==
for ($t; $t >=
$a = floor($num / pow( $base
$out = $out
$num = $num
}
return $out;
}
}
$app = new Build_URL();
$url = array(
);
foreach ($url as $v) {
$sort = $app
echo "sort link: "
$original = $app
echo "original: "
}
?>
From:http://tw.wingwit.com/Article/program/PHP/201311/21330.html