代码:
<?php
list($msec, $sec) = explode(' ', microtime());
$msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
echo $msectime; ?>
输出:
1555923393483
封装成一个方法:
public static function msectime()
{
list($msec, $sec) = explode(' ', microtime()); return (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
}