- Impact
- 0
Just simple code to generate random strings:
You can change the chars in $chars
You can change the chars in $chars
PHP:
<?
function RandomString($length)
{
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
srand((double)microtime() * 1000000);
$str = "";
$i = 0;
while ($i < $length) {
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$str = $str . $tmp;
$i++;
}
return $str;
}
$string = RandomString(5);
echo "$string";
?>