Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generate_password($length = 20)
- {
- $characters = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789');
- $password = '';
- for($i = 0; $i < $length; ++$i)
- {
- $password .= $characters[array_rand($characters)];
- }
- return $password;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement