函数:
function getExtension($filename){
$myext = substr($filename, strrpos($filename, '.'));
return str_replace('.','',$myext);
}
使用方法:
echo getExtension('我的文档.doc');
echo getExtension('sucainiu.txt');
echo getExtension('/合同/1/2/3/5.pdf');