/*
Getfiletype
Usage: Getfiletype ($filename)
*/
function Getfiletype ($Filename) {
if (Substr_count ($Filename, ".") = = 0) {//Check if there is a. number in the file name.
Return return empty
} else if (substr ($Filename,-1) = = ".") {//check whether to. end, i.e. no extension
Return return empty
} else {
$FileType = STRRCHR ($Filename, "."); Cut from the. Number
$FileType = substr ($FileType, 1); Remove. No.
return $FileType; Return
}
}
$Filename = "TESTFILENAME.PHP4";
$Filename = Getfiletype ($Filename);
Echo $Filename; Print out PHP4
?>
http://www.bkjia.com/PHPjc/509170.html www.bkjia.com true http://www.bkjia.com/PHPjc/509170.html techarticle / * Getfiletype usage: getfiletype ($filename) */function Getfiletype ($Filename) {if (Substr_count ($Filename, ".") = = 0) { Check the file name for a. Number. Return return empty ...