vendredi 2 janvier 2015

PHP Pick random array values based on total

I have array in php like



$randomarray = array('1106'=>'5','1110'=>'2','11867'=>'3','1206'=>'2','1210'=>'1','1223'=>'6','1235'=>'3','12565'=>'4','1258'=>'5','12690'=>'2','12693'=>'3','1283'=>'1','12944'=>'5');


I want to randomly pick elements from the array with the count of exactly 20. Each element have to only one time


I tried some array random example. I can't able to get the exact total which i expect.





Aucun commentaire:

Enregistrer un commentaire