PHP array_rand() FunctionThe array_rand()function is a inbuilt function in PHP. The array_rand()function is used to fetch one or more random entries from an array. It uses a pseudo-random number generator that is not suitable for cryptographic purposes. This function was introduced in PHP 4.0. SyntaxParameter
Return TypeThe array_rand() function returns the key for a random entry. Otherwise, it returns an array of keys for the random entries. Example 1Output: b Example 2Output: php ruby Example 3Output: Array ( [0] => sachin [1] => rahul ) Example 4Output: worldcup Next TopicPhp-array-range-function |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India