Created
August 16, 2017 09:06
-
-
Save Pum-purum/7a38a84328047a3b3277a5e34b9628d5 to your computer and use it in GitHub Desktop.
генерирует пароль
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
function generatePassword($length = 8){ | |
$chars = 'abdefhiknrstyzABDEFGHKNQRSTYZ23456789'; | |
$numChars = strlen($chars); | |
$string = ''; | |
for ($i = 0; $i < $length; $i++) { | |
$string .= substr($chars, rand(1, $numChars) - 1, 1); | |
} | |
return $string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment