function rnd_string($len = 24) { $str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM NOPQRSTUVWXYZ"; $result = ''; for ($i = 0; $i<$len; $i++) $result.= $str[rand ( 0, strlen ( $str ) - 1 )]; return $result;}