3
|
I want to generate unique identificator in following 12 numeric format:
Example:
Where:
YYYYMMDD is a current date value and other XXXX is randomly generated value.
Daily required unique volume is about 100. What methods using PHP should I use to prevent possible duplicates in rand values or make all id maximum unique? Maybe possible use current time functions to compact these numbers in last 4 characters?
EDITED: Unique value connected to MySQL database as prime index of table. It is initial values not connected to any stored information in database.
|
2014年10月24日 星期五
PHP Generate Unique Order Number with Date
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言