Selected value should not pick from the array_rand

c0ldb0y

New Member
Below php code I have selected "Neo" so Neo should not pick in the random selected. And another 2 value should print.\[code\] <?php $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; ?>\[/code\]And my array is Multi-dimentionnal array here is sample\[code\]array(1) { ["data"]=> array(301) { [0]=> array(2) { ["name"]=> string(10) "Some Name" ["id"]=> string(9) "5000213929" }\[/code\]
 
Back
Top