Skip to content

Instantly share code, notes, and snippets.

@lleitep3
Created May 25, 2011 01:01
Show Gist options
  • Save lleitep3/990111 to your computer and use it in GitHub Desktop.
Save lleitep3/990111 to your computer and use it in GitHub Desktop.
randomic string generator
<?php
function strRand($qtd)
{
$chars = implode(array_merge(range(0, 9),range('A', 'Z'),range('a', 'z')));
return substr(str_shuffle($chars), 0, $qtd);
}
$str = strRand(5);
echo "look: " . $str;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment