To generate a random array of numbers in PHP, we can use a combination of range
and shuffle
functions.
range
function is used to create an array containing a range of elements. We can pass the starting and ending value of the range as arguments, and it will return an array with all the elements in between.
shuffle
function is used to randomly shuffle the elements of an array.
Here's an example of how to generate a random array of numbers in PHP:
main.php168 chars11 lines
The output of the above code will be an array of numbers in random order, like this:
main.php141 chars14 lines
gistlibby LogSnag