This article describes how to obtain a timestamp in milliseconds in PHP. It involves php's processing skills for the results returned by the microtime function. It is very simple and practical. For more information, see
This article describes how to obtain a timestamp in milliseconds in PHP. It involves php's processing skills for the results returned by the microtime function. It is very simple and practical. For more information, see
This example describes how to obtain a timestamp in milliseconds in PHP. Share it with you for your reference. The specific analysis is as follows:
PHP does not provide a function for obtaining timestamp in milliseconds. You can use gettime () in java to obtain the timestamp. If you want to perform high-precision millisecond-level communication with some programs written in java, you need to use PHP to output millisecond-level time. Previously, I used an inaccurate method, that is, adding a three digit after the native time function of PHP. You can use the following code to obtain a more accurate timestamp in milliseconds:
<? Phpfunction getMillisecond () {list ($ t1, $ t2) = explode ('', microtime (); return (float) sprintf ('%. 0f', (floatval ($ t1) + floatval ($ t2) * 1000);} echo getMillisecond ();
I hope this article will help you with php programming.
,