fuction fileExtend($filename){
return pathinfo($filename, PATHINFO_EXTENSION);
}
return pathinfo($filename, PATHINFO_EXTENSION);
}
2017-02-09
課后作業:
function getfiletype($filename) {
return pathinfo($filename)["extension"];
}
echo getfiletype('func.php');
function getfiletype($filename) {
return pathinfo($filename)["extension"];
}
echo getfiletype('func.php');
2017-02-08
function str_rand($str,$codeLen){
$rand="";
//生成隨機數
for($i=1;$i<$codeLen;$i++){
$rand.=$str[mt_rand(0, strlen($str)-1)];
}
return $rand;
}
echo str_rand("12345676279381823928141231491",'5');
$rand="";
//生成隨機數
for($i=1;$i<$codeLen;$i++){
$rand.=$str[mt_rand(0, strlen($str)-1)];
}
return $rand;
}
echo str_rand("12345676279381823928141231491",'5');
2017-02-07
已采納回答 / 來自火星的Mars
可變函數是php的一個特點。用我的理解來講:變量的等效替換。下面我用個例子:# 聲明一個函數function func(){????echo ?"this is func";}# 通過函數名調用這個函數func();????????????????????????// 結果: this is func# 我們將這個函數名賦值給一個變量$func2 = "func";# 再次調用這個函數$func2();???????????????? // 結果:this is func# 然后,會發現結果相同,鑒于這種...
2017-01-25