xxxxxxxxxx
$ext = explode('.', $filename); // Explode the string
$my_ext = end($ext); // Get the last entry of the array
echo $my_ext;
xxxxxxxxxx
//Get File Extension
function getFileExtension($fileName)
{
return '.' . strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
}