php使用gettimeofday函数返回当前时间并存放在关联数组里

yipeiwu_com6年前PHP代码库

本文实例讲述了php使用gettimeofday函数返回当前时间并存放在关联数组里的方法。分享给大家供大家参考。具体分析如下:

英文官方描述如下:

Key Description
sec Seconds since midnight before January 1, 1970
usec  Microseconds since the sec value
minuteswest   
Local time zone difference from GMT, in minutes
dsttime  1 iff daylight savings time is in effect,
0 iff not.

<?php
$Now = gettimeofday();
echo "As an associative array:\n";
foreach ($Now as $Key => $Value) {
 echo "$Key => $Value\n";
}
?>

输出结果如下:

sec => 1261918156
usec => 724964
minuteswest => 0
dsttime => 0

希望本文所述对大家的php程序设计有所帮助。

相关文章

php file_get_contents取文件中数组元素的方法

用file_get_contents()抓取了 这个网址上的内容 http://simonfenci.sinaapp.com/index.php?key=simon&wd=131...

PHP判断文件是否被引入的方法get_included_files用法示例

本文实例讲述了PHP判断文件是否被引入的方法get_included_files用法。分享给大家供大家参考,具体如下: <?php // 本文件是 abc.php in...

PHP中strnatcmp()函数“自然排序算法”进行字符串比较用法分析(对比strcmp函数)

本文实例讲述了PHP中strnatcmp()函数“自然排序算法”进行字符串比较用法。分享给大家供大家参考,具体如下: PHP中strnatcmp()函数使用"自然"算法来比较两个字符串(...

PHP中使用php://input处理相同name值的表单数据

在去年10月份,我在博客中分析了php接收前台name值相同的表单提交数据的处理的问题,当时说的方案是为把name值改成数组类型,php接收到之后,再对数组进行合并处理。这样做的缺点就是...

高级php注入方法集锦第1/2页

'%23  ' and passWord='mypass  id=-1 union select 1,1,1&nbs...