/*
GetFileType
Usage: GetFiletype($filename)
*/
function GetFiletype($Filename) {
if (substr_count($Filename, "." ) == 0) { // Check whether there is a . number in the file name.
return; // Return empty
} else if (substr($Filename, -1) == ".") { Check if it ends with ., that is, no extension
return; // Return empty
} else {
$FileType = strrchr ($Filename, "."); // Cut
from . number $FileType = substr($FileType, 1); // Remove . number
return $FileType; / Print out php4
?>
http://www.bkjia.com/PHPjc/631814.html