I need to generate unique ticket numbers for an online raffle that could have around 100k tickets or so generated. I've currently got this part setup very simple:
$RandomNumber = rand(100000, 999999);
Which of course is generating a random number between 100,000 and 999,999. This is simply because my client requested a 6 digit ticket ID for all tickets.
I'm a little worried about the small possibility of a number getting assigned to 2 separate tickets. Is there way I can randomly generate all 6 digits rather than randomly grabbing a 6 digit number from this range? I think that would give me more of a guarantee that I won't ever get the same value twice.
Am I worrying too much? Any information would be greatly appreciated. Thanks!