note 53948 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:14:37 +0000 |
| Subject: | note 53948 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140701@lists.php.net to get a copy of this message | ||
Note Submitter: rsalazar at innox dot com dot mx
----
Yet another way to achieve the same effect without the loss of decimals is with the PCRE replace
function (preg_replace), which also seems to be a _bit_ faster (about 2.5E-05 sec):
<?php
$float_time = preg_replace('/^0?(\S+) (\S+)$/X', '$2$1', microtime());
?>
PS unluckypixie, "james at gogo dot co dot nz" wrote the same at Dec/2004