We can randomly collect one or more element from an array by using array_rand() function in PHP. We can specify the number of random elements required by specifying an optional parameter in side the function.

Tagged with:

Filed under: PHP

Like this post? Subscribe to my RSS feed and get loads more!