Php array random sorting implementation method. Php array random sorting implementation method this article describes how to implement php array random sorting. Share it with you for your reference. The specific implementation method is as follows: 12345? Php $ arrayarra php array random sorting implementation method
This article describes how to implement random sorting of php arrays. Share it with you for your reference. The specific implementation method is as follows:
|
1
2
3
4
5 |
$ Array = array ('A', '2', '3', '4', '5', '6', '7', '8 ', '9', '10', 'J', 'Q', 'k ');
Shuffle ($ array); // random sorting array
Print_r ($ array); // output array
?>
|
The running result is as follows:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 |
Array
(
[0] => Q
[1] => 3
[2] => 5
[3] => 2
[4] => 10
[5] => 9
[6] => K
[7] => 4
[8] => J
[9] => 6
[10] => 7
[11] => 8
[12] =>
)
|
I hope this article will help you with php programming.
Examples in this article describes how to implement random sorting of php arrays. Share it with you for your reference. The specific implementation method is as follows: 1 2 3 4 5? Php $ array = arra...