This article mainly introduces the implementation of custom functions in php to obtain the random array list. This article provides the implementation code directly. For more information, see
This article mainly introduces the implementation of custom functions in php to obtain the random array list. This article provides the implementation code directly. For more information, see
Paste a piece of code. You don't need to say much about getting random arrays in php. Directly paste the code. The array_rand in php is abnormal. It breaks through normal people's understanding and is tedious.
Function create_random_ids ($ min, $ max, $ limited) {$ _ base_ids = range ($ min, $ max); $ _ temp_key = array_rand ($ _ base_ids, min (count ($ _ base_ids), $ limited + 10); // splice $ ids = array (); for ($ x = 0; $ x <count ($ _ temp_key); $ x ++) {$ ids [] =$ _ base_ids [$ _ temp_key [$ x];} return $ ids ;}
,