Created
November 6, 2017 12:14
-
-
Save lucasferreira/01ef7a1f5446464e8c8541dcab670afa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function randomPassword($len=8) | |
{ | |
$chars = 'abcdefghijlmnopqrstuvxyzkw123456789'; | |
$numChars = strlen($chars); | |
$pwd = ''; | |
for ($i=0; $i<$len; $i++) | |
{ | |
$pwd .= substr($chars, rand(1, $numChars) - 1, 1); | |
} | |
return $pwd; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment