i have a problem with the array_rand function. here is the code:
$all = array(01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20);
$r = mt_rand(7,10);
$r_all = array_rand($all,$r);
print_r($r_all);
for($i=0;$i<$r;$i++) print $all[$r_all[$i]].'<br>';
php 4.3.3 on redhat 8.0
this returns the correct number of keys with array_rand but when using for loop to display the values for those keys from the original array - $all - sometimes it returns 0 (zero), which is not in $all.
if this isn't a bug can somebody please explain why is this happening...
thanks...