Thursday, January 18, 2007

PHP function to get extension of a file

Here is a simple usefull function to get extension of a file

function getFileExtension($filename){
$dot = substr (strrchr ($filename, "."), 1);
return ($dot);
}

No comments: