function getExt($file) { if (($i = strrpos($file, '.')) === false) return ''; return substr($file, $i + 1); }Using pathinfo() is the offical way but I prefer the above
function getExt2($file) { return pathinfo($file, PATHINFO_EXTENSION); }
function getExt($file) { if (($i = strrpos($file, '.')) === false) return ''; return substr($file, $i + 1); }Using pathinfo() is the offical way but I prefer the above
function getExt2($file) { return pathinfo($file, PATHINFO_EXTENSION); }