Created
March 15, 2015 16:40
-
-
Save boy3vil/3969e679ccf8c24d30de to your computer and use it in GitHub Desktop.
PHP id_rec microtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //id_rec generator | |
| function id_rec($set = 0){ | |
| $microtime = microtime(); | |
| $comps = explode(' ', $microtime); | |
| $ms=sprintf('%d%03d', $comps[1], $comps[0] * 1000); | |
| $ms=substr($ms,-3); | |
| return date("YmdHis", time()).sprintf("%03d", ($ms+$set)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment