php get file extension
snippet in php

php get file extension from filename

user4669

$ext = pathinfo($filename, PATHINFO_EXTENSION);

php get file extension

user6554

$path ="/some/path/to/myfilename.html"; 
$ext = pathinfo($path, PATHINFO_EXTENSION);//ext is "html"