Php array random sorting methods. In php, if we want to make the random sorting of arrays, we only need to use the shuffle function, but shuffle can only use one-dimensional arrays. the following small series will introduce several array sorting methods. In php, if we want to make the random sorting of arrays, we only need to use the shuffle function, but shuffle can only use one-dimensional arrays. the following small series will introduce several array sorting methods.
The shuffle function can be used in php to implement random array sorting.
The code is as follows: |
|
$ Test = array (); $ Test [] = array ( 'Title' => 'q1. what is a more scientific Security Algorithm? ', ); $ Test [] = array ( 'Title' => 'Q2. what is a more scientific Security Algorithm? ', ); $ Test [] = array ( 'Title' => 'q3. what is a more scientific Security Algorithm? ', ); $ Test [] = array ( 'Title' => 'q4. what is a more scientific Security Algorithm? ', ); // Random sorting Shuffle ($ test ); Print_r ($ test ); ?> |
....