Skip to content

Instantly share code, notes, and snippets.

@flacodirt
Created April 12, 2013 14:38
Show Gist options
  • Save flacodirt/5372475 to your computer and use it in GitHub Desktop.
Save flacodirt/5372475 to your computer and use it in GitHub Desktop.
Random passphrase generator will return random characters 33 - 126
/**
* randomPassphrase
*/
function randomPassphrase ($len = 12) {
$r = '';
for ($i=0; $i<$len; $i++) {
$r .= chr(mt_rand(33,126));
}
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment