function u_decode($uri) {
preg_match('/^\/([az09_]+)_([09af]+)x([09af]+).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);
return 'http://'.$match[1].'.abc.com/a/'.$date.'/'.$id.'.htm';
}
======================求助,
增加一个判断输出
如果$match[1]=news
输出return 'https://'.$match[1].'.abc.com/a/'.$date.'/'.$id.'.htm';
其他
输出return 'http://'.$match[1].'.abc.com/a/'.$date.'/'.$id.'.htm';
区别在于输出:https与http的不同.
谢谢!
新注册用户,无金币悬赏.不胜感激!!!
求助,php增加一个判断
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-