PHP查询文件扩展名

 1 //查询文件扩展名
 2 function extension($str){
 3     $str = implode("",explode("\\",$str));
 4     $str = explode(".",$str);
 5     $str = strtolower(end($str));
 6     return $str;
 7 }
 8 
 9 $file = 'D://a\b\name-Of_somefile.File.txt';
10 echo extension($file);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-07-18
  • 2021-12-15
  • 2021-09-07
  • 2021-11-11
  • 2022-02-18
猜你喜欢
  • 2021-08-26
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案