好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php如何获取文件后缀方法

本教程讲解php如何获取文件后缀方法

方法1:

function get_file_type($filename){
  $type = substr($filename, strrpos($filename, ".")+1);
  return $type;
}

方法2:

function get_file_type($filename)
{
   $type = pathinfo($filename);
   $type = strtolower($type["extension"]);
   return $type;
}

方法3:

function get_file_type($filename)
{  
   $type =explode("." , $filename);
   $count=count($type)-1;
   return $type[$count];
}

查看更多关于php如何获取文件后缀方法的详细内容...

  阅读:49次