ArchiveApril 2014

PHP Passwords with Character Arrays


Here’s a simple function I recently wrote to randomly generate passwords in PHP. ‌PHP Password Generator //Generate new password $characterPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-_+=:;<>?'; $newPassword = ''; while(strlen($newPassword)<8) $newPassword .= $characterPool[mt_rand(0,strlen($characterPool)-1)]; 12345 //Generate new...

Chris Peterson

Chris Peterson

As a Web Application Developer & Elephant Trainer I have been putting the PHP mascot to work for more than a decade. I specialize in back-end development and use the LAMP stack to craft software that frees human beings to spend their time on more productive and rewarding things.

Recent Posts

Recent Comments