Skip to content

Instantly share code, notes, and snippets.

@waelio
Last active December 29, 2015 13:11
Show Gist options
  • Save waelio/c46e3045b9a051a88457 to your computer and use it in GitHub Desktop.
Save waelio/c46e3045b9a051a88457 to your computer and use it in GitHub Desktop.
Random Password from predefined dictionary
<?php
function generate_password($length = 64){
$box_array = array( 'jhg','RTJ','ZCG','{;G','KRA','!','@','$','%','^','&','*','(',')','_','=','+' );
$password='';
for($x=0; $x < $length; $x++){
$password .= $box_array[intval(array_rand($box_array))];
}
return $password;
}
echo generate_password(12);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment