PHP 获取URL的文件后缀名答案PHP 获取URL的文件后缀名答案PHP获取URL的文件后缀名代码: function getExt($url) { $data = parse_url($url); $path = $data['path']; $info = pathinfo($path); return $info['extension'];}echo getExt('http://www.jintix.com/q/1670.html?id=1670');// 结果: html