Skip to content

Instantly share code, notes, and snippets.

@Pum-purum
Created August 16, 2017 09:06
Show Gist options
  • Save Pum-purum/7a38a84328047a3b3277a5e34b9628d5 to your computer and use it in GitHub Desktop.
Save Pum-purum/7a38a84328047a3b3277a5e34b9628d5 to your computer and use it in GitHub Desktop.
генерирует пароль
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