Home >>PHP Date Time Functions >PHP microtime() Function
PHP microtime() function is used to return the current Unix timestamp with microseconds. It accepts only a single parameter which is optional. It returns the string microsec sec as output.
Syntax:
microtime(return_float);
Parameter | Description |
---|---|
return_float | This is an optional parameter. When it is set to TRUE it specifies that the function should return a float instead of a string. |
Here is an example of microtime() function in PHP:
<html> <body> <?php echo microtime(); ?> </body> </html>
Example 2:
<html> <body> <?php echo microtime()."<br>"; echo microtime(true); ?> </body> </html>