php使用gettimeofday函数返回当前时间并存放在关联数组里
本文实例讲述了php使用gettimeofday函数返回当前时间并存放在关联数组里的方法。分享给大家供大家参考。具体分析如下:
英文官方描述如下:
Key Description
sec SecondssincemidnightbeforeJanuary1,1970
usec Microsecondssincethesecvalue
minuteswest
LocaltimezonedifferencefromGMT,inminutes
dsttime 1iffdaylightsavingstimeisineffect,
0iffnot.
<?php
$Now=gettimeofday();
echo"Asanassociativearray:\n";
foreach($Nowas$Key=>$Value){
echo"$Key=>$Value\n";
}
?>
输出结果如下:
sec=>1261918156 usec=>724964 minuteswest=>0 dsttime=>0
希望本文所述对大家的php程序设计有所帮助。