The array_rand() function used for returns the key (or keys) of the random entries from an array.
Syntax
array_rand(array,number)
Example
$a=array("a"=>"ram","b"=>"shyam","c"=>"ravi");
print_r(array_rand($a,1));
Output
b
Copyright ©2022 coderraj.com. All Rights Reserved.