好得很程序员自学网

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

php获取文件扩展名 - php文件操作

php获取文件扩展名

<?php    /*** example usage ***/   $filename  =  'filename.blah.txt' ;    /*** get the path info ***/   $info  =  pathinfo ( $filename );    /*** show the extension ***/   echo   $info [ 'extenstion' ];  //开源代码phpfensi.com   ?>    //第二种方法也基本相同以上,但使用字符串操作获得延长和争夺点(.)字符也。       <?php    /*** example usage ***/   $filename  =  'filename.blah.txt' ;    echo  getFileExtension( $filename );    /**   *   * @Get File extension from file name   *   * @param string $filename the name of the file   *   * @return string   *   **/   function  getFileExtension( $filename ){     return   substr ( $filename ,  strrpos ( $filename ,  '.' ));  }  ?>

查看更多关于php获取文件扩展名 - php文件操作的详细内容...

  阅读:65次