
Giuseppe Leone - 2006-08-15 11:10:11 -
In reply to message 1 from Muhammad Sohail Khan
Hi Muhammuad,
we must consider that a file's name could contains more than one dot, inside !!! This is the right example to retrieve the "real" extension of a file:
<?php
$myFile = "MyName.MyFirstExt.MySecondExt.MyLastExt.txt";
$myExt = explode(".",$myFile);
//This is the real extension
echo $myExt[count($myExt)-1];
?>
Soon,
Giuseppe Leone
P.S.
Sorry for my english ;)