获取不带扩展名的文件名

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取不带扩展名的文件名相关的知识,希望对你有一定的参考价值。

  1. /**
  2.  * Get filename without the extension
  3.  *
  4.  * @param string $filename File name
  5.  * @return string Filename without the extension
  6.  */
  7. function dropExtension($filename) {
  8. return substr($filename, 0, strrpos($filename, "."));
  9. }

以上是关于获取不带扩展名的文件名的主要内容,如果未能解决你的问题,请参考以下文章