I need to create a random number with x amount of digits.
So lets say x is 5, I need a number to be eg. 35562 If x is 3, then it would throw back something like; 463
the simplest way i can think of is using rand function with str_pad
rand
str_pad
In above example , it will generate random number in range 0 to 999.
And having 5 digits.