This is a question you can read everywhere on the web with various answers:
$ext = end(explode(\'.\', $filename)); $ext = substr(strrchr($filename, \'.\'), 1
pathinfo()
$path_info = pathinfo('/foo/bar/baz.bill'); echo $path_info['extension']; // "bill"