Home > Backend Development > PHP Tutorial > PHP uses the gettimeofday function to return the current time and store it in an associative array, PHP array function_PHP tutorial

PHP uses the gettimeofday function to return the current time and store it in an associative array, PHP array function_PHP tutorial

WBOY
Release: 2016-07-13 10:02:03
Original
914 people have browsed it

PHP uses the gettimeofday function to return the current time and stores it in an associative array. PHP array function

The example in this article describes how PHP uses the gettimeofday function to return the current time and stores it in an associative array. method. Share it with everyone for your reference. The specific analysis is as follows:

The official English description is as follows:

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.

<&#63;php
$Now = gettimeofday();
echo "As an associative array:\n";
foreach ($Now as $Key => $Value) {
 echo "$Key => $Value\n";
}
&#63;>
Copy after login

The output results are as follows:

sec => 1261918156
usec => 724964
minuteswest => 0
dsttime => 0
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/970867.htmlTechArticlephp uses the gettimeofday function to return the current time and store it in an associative array. The php array function is an example of how php uses gettimeofday. The function returns the current time and stores it in an associative array...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template