By randomly extracting one or more cell methods from an array, we use Array_rand (), which is useful when you want to remove one or more random cells from an array. It accepts input as an input array and an optional parameter, Num_req, indicating how many units you want to remove-if not specified, the default is 1. If you only take one, Array_rand () returns the key name of a random cell, or returns an array containing a random key name
$a =array ("a" = "dog", "b" = "Cat", "C" and "Horse");
Print_r (Array_rand ($a, 1));
?>
http://www.bkjia.com/PHPjc/445354.html www.bkjia.com true http://www.bkjia.com/PHPjc/445354.html techarticle by randomly extracting one or more cell methods from an array, we use Array_rand (), which is useful when you want to remove one or more random cells from an array. It accepts input as input number ...