How to randomize array in PHP ?
If you want to random order of elements in your php array, use shuffle function:
$somethings = array(); $somethings[0] = "element1"; $somethings[1] = "element2"; $somethings[2] = "element3"; shuffle( $somethins );
Notice that this will modify that array wich you put as a argument (pass by reference)
Comments
Post a Comment