hello all.
I am using this code to randomly select one value from an array.
srand ();
$rec = array("1","2"," 3","4","5","6") ;
$rec = $rec[rand(0,count($r ec))];
print $rec;
problem is, is sometimes it returns nothing. can anyone see how
to make this so it always selects something.
thanks.
I am using this code to randomly select one value from an array.
srand ();
$rec = array("1","2"," 3","4","5","6") ;
$rec = $rec[rand(0,count($r ec))];
print $rec;
problem is, is sometimes it returns nothing. can anyone see how
to make this so it always selects something.
thanks.
Comment