jeudi 6 septembre 2018

How Do I Randomly Generate (Unique) 3 Digit Number in PHP without repetition?

Please, I'm new to PHP and currently working on a School Portal.

How do I keep generating 3 digit number without repetition?

Assuming the School is Uche High School, I want Student Registration Number to look like: UHS/2018/234

I've used rand() and mt_rand() but wasn't getting unique random numbers, I had repetitions in the 1st 1000 random numbers I generated.

Thanks as I believe someone can be of help...




Aucun commentaire:

Enregistrer un commentaire