Skip to content

Instantly share code, notes, and snippets.

@Tom-Millard
Created October 16, 2014 14:23
Show Gist options
  • Select an option

  • Save Tom-Millard/b2b946fbaec7d792bc6c to your computer and use it in GitHub Desktop.

Select an option

Save Tom-Millard/b2b946fbaec7d792bc6c to your computer and use it in GitHub Desktop.
Create secure string
function gen_secure_id($size){
$char = range("a", "z");
$numb = range(1, 9);
$merge = array_merge($char, $numb);
$string = "";
for($x=0; $x != $size; $x++){
$n = "";
$n = rand(0, count($merge) -1);
$string .= $merge[$n];
}
return trim($string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment