PHP isset()和empty()的區別
isset判斷的是 "變數"
empty判斷的是 "值"
http://www.compileonline.com/execute_php_online.php
[PHP]紀錄程式執行時間
function getMicrotime(){
//microtime會回傳微秒及秒(msec sec)
$arr = explode(" ",microtime());
return $arr[0] + $arr[1];
}
//紀錄開始時間
$start = getMicrotime();
$str = "";
for( $i = 0; $i <= 1000000 ; $i++) $str .= "Hello";
//結束時間
$end = getMicrotime();
echo "程式執行了 " . ($end - $start) . "秒 " . (($end - $start) /60 ) . "分";;
?>
How to get file name from full path with PHP?
$file = basename($path); // $file is set to "index.php"
$file = basename($path); // $file is set to "index.php"
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。