This article introduces the content of the PHP array of random number generation, has a certain reference value, now share to everyone, the need for friends can refer to
<?php//Array_rand (); Randomly remove one or more cells from an array//if the Array_rand does not write the length parameter or the parameter is 1, the return is not an array, but an integer of type int, such as the next Var_dump, In this case, assigning a value to the variable Array_merge will give an error. Var_dump (Array_rand (range (0,9), $length));//Array_flip (); Swaps the keys and values in the array/range (); Creates an array from the range that contains the specified element//shuffle-scrambled array, Returns a Boolean value that is not suitable for this case $merge=array_rand (Array_flip (Array_merge (range (' A ', ' Z '), Range (0,9)), 4);p Rint_r ($merge);?>
<?php//join (', $array) an array with an empty connection and returns a string, and join is the alias of implode $str=join ("', Array_rand (Array_flip (Array_merge (' a ') , ' Z '), Range (0,9)), 4); Var_dump ($STR);?>