Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
Last active January 9, 2018 18:55
Show Gist options
  • Save joshbuchea/91fdcfe0e0925e69a60a to your computer and use it in GitHub Desktop.
Save joshbuchea/91fdcfe0e0925e69a60a to your computer and use it in GitHub Desktop.
Generate random passwords
<?php
function random_password( $length = 8 ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
$password = substr( str_shuffle( $chars ), 0, $length );
return $password;
}
?>
@shubham2rai
Copy link

Can any body explain it to me please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment