Hi, I already looked at the php manual about unix and don't understand it. What does the microtime function do in php? Thanks a lot.
What is microtime in php?
The time() function returns the current "Unix time" in seconds as an integer. ("Unix time" is the number of seconds since the "Unix Epoch", which is 1970/01/01-00:00:00 UTC.) microtime() does the same functionality, except it gives the number of seconds and microseconds, either as a float (339231234.123456) if TRUE is supplied for the optional argument, or else as a string in the format ".123456 339231234" (the first part of the string is the microseconds portion, the second part the seconds; and no, I have no idea why they did it that way).
Wow. If I was to call something by microtime, would it still need a page refreshes to keep the time going? Thank you.
All microtime() or time() can do is return the current server time at the moment the command is executed on the server. If the intent is to present some sort of continuously updating clock or timer on the client side (i.e.: the browser), you'd probably be better off using JavaScript to do it, rather than a continual stream of requests to the server to get the current time.