function getExt($filename){
$pos = strripos($filename,".");
if(!$pos){
return "扩展名不存在!";
}else {
return substr($filename, $pos + 1);
}
}
$pos = strripos($filename,".");
if(!$pos){
return "扩展名不存在!";
}else {
return substr($filename, $pos + 1);
}
}
2021-01-16
function catchExte($sExtension){
$sStr = strchr($sExtension,'.');
$sResult = substr($sStr, 1);
return $sResult;
}
$sString = '1fdsf23.html'; //输入123.php txt.html等等
$sFunc = catchExte($sString);
var_dump($sFunc);
$sStr = strchr($sExtension,'.');
$sResult = substr($sStr, 1);
return $sResult;
}
$sString = '1fdsf23.html'; //输入123.php txt.html等等
$sFunc = catchExte($sString);
var_dump($sFunc);
2019-04-12