Skip to content

Instantly share code, notes, and snippets.

@nitrix
Created September 9, 2012 01:44
Show Gist options
  • Save nitrix/3682000 to your computer and use it in GitHub Desktop.
Save nitrix/3682000 to your computer and use it in GitHub Desktop.
<?php
function makeRandomPassword($length) {
$pass = '';
$characters = 'abcdefghijkmnopqrstuvwxyz23456789';
srand((double)microtime()*1000000);
for($i=0; $i<$length; $i++) {
$random = rand() % 33;
$pass .= substr($characters, $random, 1);
}
return $pass;
}
echo makeRandomPassword(10);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment