SyntaxFix
Write A Post
Hire A Developer
Questions
If you want it to start at 000001 and go to 999999:
000001
999999
$num_str = sprintf("%06d", mt_rand(1, 999999));
Mind you, it's stored as a string.