取文件后缀的函数

来源:互联网 发布:运动护具 知乎 编辑:程序博客网 时间:2024/04/30 16:33
/*********************************************************************
  函数名称: getPostfix
  功能描述: 取文件后缀
  被访问表: none
  被修改表: none
  输入参数: $filename ----------------- 文件名
  输出参数: $postfix ------------------ 后缀
  函数返回: str
  其他说明: 2004-9-17
**********************************************************************/
function getPostfix($filename)
{
 $postfix = substr(strrchr(trim(strtolower($filename)),"."),1);
 Return $postfix;
}