ファイルの拡張子を取得

2017/02/08

$filepath = pathinfo('/hoge/hoge/file.txt');
$ext = $filepath['extension']; // txt


別の方法

$ext = array_pop(explode('.',$fp));