Generate n digits password like OTP

$n=6;
        $generator = "1357902468";
        $otp="";
        for ($i = 1; $i <= $n; $i++) { 
                $otp .= substr($generator, (rand()%(strlen($generator))), 1); 
            }
© 2016 - 2022, All Rights are Reserved.