Last active
January 9, 2018 18:55
-
-
Save joshbuchea/91fdcfe0e0925e69a60a to your computer and use it in GitHub Desktop.
Generate random passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function random_password( $length = 8 ) { | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; | |
$password = substr( str_shuffle( $chars ), 0, $length ); | |
return $password; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can any body explain it to me please