To create a password with numbers in php, you can use the rand
function to generate a random integer between 0 and 9 and append it to your password string. You can repeat this step for the desired length of your password. Here's an example:
main.php120 chars9 lines
In this example, a password of length 8 is generated using rand
to append a random integer between 0 and 9 to the password
string for 8 iterations of the loop. The resulting password will be a random sequence of 8 numbers.
gistlibby LogSnag