-
Notifications
You must be signed in to change notification settings - Fork 15
array_rand
Chung Leong edited this page Jan 10, 2022
·
3 revisions
array_rand - Pick one or more random entries out of an array
uint32 array_rand( array $array )
uint32[num] array_rand( array $array, uint32 $num_req )
array_rand() picks one or more random entries out of an array, and returns the key (or keys) of the random entries.
array - The input array.
num_req - The number of entries to pick.
An array containing keys to the random entries. It is a scalar if num_req is omitted or is the constant 1.
1.0 and above.