PHP中 获取全路径的文件的扩展名

function getExtension($file) {
    return pathinfo($file, PATHINFO_EXTENSION);
}

  

function getExtension($file) {
    $file = basename($file);
    $info = explode('.', $file);
    if (count($info)<2) {
        return '';
    }
    end($info);
}

  

posted @ 2014-04-21 14:18  vo_ov  阅读(262)  评论(0编辑  收藏  举报