Wednesday, August 29, 2007

get_rand_nos($max,$count)




function get_rand_nos($max,$count)
{
for($i=0;$i<$max;$i++)
{
$range[]=$i;
}
for($i=0;$i<$count;$i++)
        {
        $rand_list[]=$i;
        }
foreach($range as $re)
  {
  if(mt_rand(0,1))
        {
        $rand_list[mt_rand(0,$count-1)]=$re;
        }
}
return $rand_list;
}




No comments:

Post a Comment