Skip to content

Instantly share code, notes, and snippets.

@N-Porsh
Last active December 28, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save N-Porsh/7525543 to your computer and use it in GitHub Desktop.
Save N-Porsh/7525543 to your computer and use it in GitHub Desktop.
PHP: password generator
function random_password($chars = 8) {
$letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-+=_,!@$#*%<>[]{}';
return substr(str_shuffle($letters), 0, $chars);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment