note 10149 deleted from rand by philip

From: Date: Sun, 26 Aug 2001 10:23:03 +0000
Subject: note 10149 deleted from rand by philip
Groups: php.notes 
Request: Send a blank email to php-notes+get-17155@lists.php.net to get a copy of this message
Slightly Modified to create a Random Order Number, but converting to UpperCase for those who don't want to deal with Case Sensitivity like me. Really just testting to see if this formats correctly on php. function genordernum ($order_num_len = 10) { $nps = ""; mt_srand ((double) microtime() * 1000000); while (strlen($nps)<$order_num_len) { $c = chr(mt_rand (0,255)); if (eregi("^[A-Z0-9]$", $c)) $nps = $nps . strtoupper($c); } return ($nps); }

« previous php.notes (#17155) next »