To generate a random array in PHP, you can use the range
function to create an array with a sequence of numbers, and then use the shuffle
function to randomize the order of the elements in the array. Here's an example code snippet:
main.php191 chars11 lines
This code will output an array with numbers from 1 to 10 in random order, for example:
main.php141 chars14 lines
gistlibby LogSnag