Here’s a simple function I recently wrote to randomly generate passwords in PHP. //Generate new password $characterPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-_+=:;<>?'; $newPassword = ''; while(strlen($newPassword)<8) $newPassword .= $characterPool[mt_rand(0,strlen($characterPool)-1)]; Simplified a bit, this is equivalent to: //Generate new...
PHP Passwords with Character Arrays
P
Recent Comments