发布于 5年前

php 返回当前的毫秒时间戳

代码:

echo microtime()."\r\n";
echo msectime();
function msectime() {
    list($msec, $sec) = explode(' ', microtime());
    $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
    return $msectime;
 }

输出:

0.29730100 1564797743
1564797743297
©2020 edoou.com   京ICP备16001874号-3