PHP gettimeofday() 函數
實例
返回當前時間:
<?php
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
定義和用法
gettimeofday() 函數返回當前時間。
語法
gettimeofday(return_float);
參數 | 描述 |
---|---|
return_float | 可選。當設置為 TRUE 時,返回一個浮點數,而不是一個數組。默認是 FALSE。 |
技術細節
返回值: | 默認返回一個關聯數組,帶有如下數組鍵名:R
|
---|---|
PHP 版本: | 4+ |
更新日誌: | PHP 5.1.0:新增了return_float 參數。 |
