標籤:格林威治 count 紀元
1、count()別名sizeof():計算數組中的單元數目或對象中的屬性個數
<?php
$food = array( ‘fruits‘ => array( ‘orange‘ , ‘banana‘ , ‘apple‘ ),
‘veggie‘ => array( ‘carrot‘ , ‘collard‘ , ‘pea‘ ));
// recursive count
echo count ( $food , COUNT_RECURSIVE ); // output 8
// normal count
echo count ( $food ); // output 2
?>
2、time():返回自從 Unix 紀元(格林威治時間 1970 年 1 月 1 日 00:00:00)到目前時間的秒數
3、mt_rand() :選擇性參數 min 和 max , mt_rand() 返回 0 到 mt_getrandmax() 之間的偽隨機數 mt_rand(5, 15)
4、mt_getrandmax() : 返回調用 mt_rand() 所能返回的最大的隨機數
5、move_upload_file():將上傳的檔案移動到新位置
6、explode(‘?‘,$str):用?分割字串
7、pathinfo();
<?php
$path_parts = pathinfo ( ‘/www/htdocs/inc/lib.inc.php‘ );
echo $path_parts [ ‘dirname‘ ], "\n" ;
echo $path_parts [ ‘basename‘ ], "\n" ;
echo $path_parts [ ‘extension‘ ], "\n" ;
echo $path_parts [ ‘filename‘ ], "\n" ;
?>
輸出:
/www/htdocs/inc lib.inc.php php lib.inc8、unipid(): uniqid ([ string $prefix = "" [, bool $more_entropy = false ]] ) 擷取一個帶首碼、基於目前時間微秒數的唯一ID
本文出自 “AidanDai” 部落格,請務必保留此出處http://562097645.blog.51cto.com/9361855/1566103
php函數小結2014.10.19