Wednesday, April 14, 2010

separates the extension

//This function separates the extension from the rest of the file name and returns it
function findexts ($filename)
{
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}

//This applies the function to our file
$ext = findexts ($_FILES['uploaded']['name']) ;
?>

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home