PHP中获取文件扩展名?
男神
男神 2016-12-20 16:48:46
0
2
980
男神
男神

╰つ ゛思 绪 万 千 , 不 如 努 力 向 前 .ヽ

全部回覆(2)
数据分析师

PHP中取得檔案副檔名? -PHP中文網路問答-PHP取得檔案副檔名? -PHP中文網問答

圍觀一下哦,學習一下。

迷茫

第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);
}

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!