php 获取后缀的几种方法
时间:2014-08-11 14:47:52
收藏:0
阅读:264
1: function get_extension($file){ substr(strrchr($file, ‘.‘), 1); } 2: function get_extension($file){ return substr($file, strrpos($file, ‘.‘)+1); } 3: function get_extension($file){ return end(explode(‘.‘, $file)); } 4: function get_extension($file){ $info = pathinfo($file); return $info[‘extension‘]; } 5: function get_extension($file){ return pathinfo($file, PATHINFO_EXTENSION); }
评论(0)