He edited the post, but forgot to change the HTML code inserted by the forum's parser.
Here's a simple implementation:
<?php
function genRandStr($len) {
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
$max = 35; //or (strlen($chars) - 1)
$ret = '';
for ($i = 0; $i < $len; $i++)
$ret .= $chars{mt_rand(0, $max)};
return $ret;
}
echo genRandStr(8);
?>