10,607
社区成员
发帖
与我相关
我的任务
分享
function u_decode($uri) {
preg_match('/^\/([a-z0-9_\-]+)_([0-9a-f]+)x([0-9a-f]+)\.html$/', $uri, $match);
if (!$match) return null;
$date = base_convert(strval($match[2]), 16, 10);
$id = base_convert(strval($match[3]), 16, 10);
$id = str_pad(strval($id), 6, '0', STR_PAD_LEFT);
if($match[1]=='news') return 'https://'.$match[1].'.abc.com/a/'.$date.'/'.$id.'.htm';
else return 'http://'.$match[1].'.abc.com/a/'.$date.'/'.$id.'.htm';
}