在我们日常开发中,这种毫秒时间戳作为接口的一些参数,用的也越来越广泛,尤其是对接java接口的时候,我们签名加密及参数传递的时候,关于传递时间的 基本都会用到毫秒时间戳!
下面是我在其他地方 搜刮来的 一个放法! 共享下! 你们在获取的时候也要自己检查下我的有没有问题撒~
/**
* 获取毫秒时间戳
*/
function timestamp(){
list($msec, $sec) = explode(' ', microtime());
$msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
return $msectimes = substr($msectime,0,13);
}