/**
* 根据文件名,返回文件的扩展名
* @param string $fileName
* @return string extendName
*/
function getExtendName($fileName){
$arr = explode('.',$fileName);
return $arr[count($arr)-1];
}
* 根据文件名,返回文件的扩展名
* @param string $fileName
* @return string extendName
*/
function getExtendName($fileName){
$arr = explode('.',$fileName);
return $arr[count($arr)-1];
}
2017-04-22
function getType($name){
$arr = explode('.',$name);
$i = count($arr);
$result = $arr[$i-1];
return $result;
}
echo getType("xx.txt.php");
$arr = explode('.',$name);
$i = count($arr);
$result = $arr[$i-1];
return $result;
}
echo getType("xx.txt.php");
2017-04-22
function getEnd($filename){
$arr = explode('.', $filename);
$result = end($arr);
return $result;
}
echo getEnd("ks.class.php");
$arr = explode('.', $filename);
$result = end($arr);
return $result;
}
echo getEnd("ks.class.php");
2017-04-12