I am developing a event organization website. Here when the user registers for an event he will be given a unique random number(10 digit), which we use to generate a barcode
You can use php's uniqid() function to generate a unique ID based on the microtime (current time in microseconds)
Example:
Output:
56c3096338cdb