March 2002
Intermediate to advanced
528 pages
21h 29m
English
array_rand
mixed array_rand(arrayarray[, intcount])
Picks a random element from the given array. The second, optional, parameter can be given to specify a number of elements to pick and return. If more than one element is returned, an array of keys is returned, rather than the element’s value.
Before you call array_rand( ), be sure to seed the
random-number generator using srand( ).