generateID.php 274 B

12345678910111213141516
  1. <?php
  2. function generateID() {
  3. // Generate id based on the current microtime
  4. $id = str_replace('.', '', microtime(true));
  5. // Ensure that the id has a length of 14 chars
  6. while(strlen($id)<14) $id .= 0;
  7. // Return the integer value of the id
  8. return intval($id);
  9. }
  10. ?>