Home >Backend Development >PHP Tutorial >PHP implementation method of returning 13-digit timestamp

PHP implementation method of returning 13-digit timestamp

墨辰丷
墨辰丷Original
2018-06-02 11:33:536981browse

This article mainly introduces the implementation method of PHP returning 13-digit timestamp. Interested friends can refer to it. I hope it will be helpful to everyone.

The 13-digit timestamp generation function is as follows:

private function getMillisecond() { 
  list($t1, $t2) = explode(' ', microtime()); 
  return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000); 
}

Summary: The above is all of this article Content, I hope it will be helpful to everyone’s study.

Related recommendations:

PHP connects to the MySQL database and outputs it in json format

php ajax Detailed explanation of the example of implementing the upload image function with a progress bar

PHP method to implement a certain key sorting of a two-dimensional array

The above is the detailed content of PHP implementation method of returning 13-digit timestamp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn