php random x digit number - Stack Overflow

PHOTO EMBED

Sun Jun 25 2023 10:58:08 GMT+0000 (Coordinated Universal Time)

Saved by @ajay579 #php

$digits = 3;
echo rand(pow(10, $digits-1), pow(10, $digits)-1);
content_copyCOPY

https://stackoverflow.com/questions/8215979/php-random-x-digit-number