0

I have to generate a 6 digit random number using rand in php. Here is my code:

echo rand(000000,999999);

The outputs are always in 6 digits like 124562, 785346, etc. My doubt is 000000 will be considered as single 0 or 6 zeros? and output will always be 6 digit or it will be something between 0 to 999999?

tata mic
  • 1
  • 2
  • The value will still be in 6 figures.I suggest you use mt_rand(000000,999999) the latest way of generting random nnumber – Kabiru Wahab Dec 01 '21 at 08:05

0 Answers0