php生成指定位数(13位)的时间戳

 

 

/**
	 * 
	* 返回一定位数的时间戳,多少位由参数决定
	*
	* @author 陈博
	* @param type 多少位的时间戳
	* @return 时间戳
	 */
	private function getTimestamp($digits = false) {
		$digits = $digits > 10 ? $digits : 10;
		$digits = $digits - 10;
		if ((!$digits) || ($digits == 10))
		{
			return time();
		}
		else
		{
			return number_format(microtime(true),$digits,'','');
		}
	}
 

 


版权声明:本文为JIANDANQINXINILOVEYO原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。