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

PHP implementation method of returning 13-digit timestamp

墨辰丷
Release: 2023-03-29 14:16:02
Original
6978 people have browsed it

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); 
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template