Skip to content

Instantly share code, notes, and snippets.

@yavgel85
Created March 26, 2021 08:33
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 yavgel85/6108cd7da3003bef6d5026b1d5ab2d89 to your computer and use it in GitHub Desktop.
Save yavgel85/6108cd7da3003bef6d5026b1d5ab2d89 to your computer and use it in GitHub Desktop.
Random Password #php #auth
function random_password($length = 12)
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
return substr(str_shuffle($chars), 0, $length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment