PHP 获取文件扩展名 后缀名

 

   PHP 获取文件扩展名


    原文地址:http://www.51ask.org/question/226

第1种方法:
function get_extension($file)
{
substr(strrchr($file, '.'), 1);
}
第2种方法:
function get_extension($file)
{
return substr($file, strrpos($file, '.')+1);
}

猜你喜欢

转载自51ask.iteye.com/blog/2369818