PHP array random Sorting implementation method, PHP array sorting
In this paper, we describe the implementation method of PHP array random ordering. Share to everyone for your reference. The implementation method is as follows:
<?php $array = Array (' A ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', ' Ten ', ' J ', ' Q ', ' K '); Shuffle ($array); Randomly sorted array print_r ($array); Output array?>
The results of the operation are as follows:
Array ( [0] = Q [1] = 3 [2] = 5 [3] = 2 [4] = [5] = 9 [6] = = K
[7] + 4 [8] = J [9] = 6 [Ten] = 7 [one] = 8 [k] = A)
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1016330.html www.bkjia.com true http://www.bkjia.com/PHPjc/1016330.html techarticle PHP array Random sorting implementation method, PHP array Sorting This article describes the PHP array random ordering implementation method. Share to everyone for your reference. The implementation method is as follows: PHP $array ...