PHP array_rand() Function returns one or more random key from an array. The array_rand() is a built-in function of PHP.
Syntax :
array_rand($array, $number);
Parameter,
$array : Required It is type of array parameter.
$number : Optional. It specifies how many random keys to return.
Let's see below example to understand php array_rand() Function in details.
Return : A array_rand() Function returns one key randomly from an array if number parameter is not specified.
Comments