Array_rand---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Randomly select one or more values of an array
Syntax: mixed array_rand (array input [, int num_req])
Description:
Array_rand () is useful when you want to randomly select one or more of the values of an array, the argument num_reg is not necessary, it indicates that you want to select a few values out, if not specified, then its default value is 1.
If you select only one value, Array_rand () returns the index of the random value. Otherwise, it returns the index of the random value in the array and returns the array. This way you can not only pick random index values but also output the values of the array.
Don't forget to call Srand () to set the number of random seeds.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.