Reputation: 139862
I have an array of 50 items and I would like to choose 5 of them randomly and get an array back. Is there a function for this?
Upvotes: 3
Views: 867
Reputation: 26535
Put the items in an array and use:
$selectrand = array_rand($arrayname, 5);
Upvotes: 7