function getExt($filename){
$pos = strripos($filename,".");
if(!$pos){
return "擴(kuò)展名不存在!";
}else {
return substr($filename, $pos + 1);
}
}
$pos = strripos($filename,".");
if(!$pos){
return "擴(kuò)展名不存在!";
}else {
return substr($filename, $pos + 1);
}
}
2021-01-16
最新回答 / 星隨
正則表達(dá)式function?file1($file_name='text.txt'){????$sss='|\.[\w]+$|';????$file_name=$file_name;????$ccc=NULL;????if(preg_match($sss,$file_name,$match)){????????$bbb=$match[0];????????return?$bbb;????}else{????????return?$ccc;????}echo?file1('1');echo?"<br&...
2020-06-30
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
最新回答 / 街長(zhǎng)
call_user_func()方法是回調(diào)函數(shù),function($username){echo "hello {$username}";}這部分是匿名函數(shù),相當(dāng)于function A($username){echo "hello".$username;}"king"是要傳遞的參數(shù),傳給$username;相當(dāng)于是A(‘King’);
2019-03-16
已采納回答 / _Jack_Han_
把第五行改成 $filearray = str.split($file);array(str.split($file))是一個(gè)二維數(shù)組,你打印出來看一看就知道了。
2018-12-30
回調(diào)函數(shù)是一種類型,準(zhǔn)確地講應(yīng)該是,匿名函數(shù)經(jīng)常用作函數(shù)的回調(diào)函數(shù)類型的參數(shù)。
2018-10-07