- preg_split: documentation ( source)
- rand: documentation ( source)
<?php
function get_rand_str($len){
$result='';
$chars=preg_split('//','abcdef0123456789');
for($i=0;$i<$len;$i++) $result.=$chars[rand(0,count($chars)-1)];
return $result;
}
echo get_rand_str(36);