In php, array_multisort() can sort multiple arrays at one time, or sort multi-dimensional arrays according to a certain dimension or multiple dimensions. It returns TRUE if successful and FALSE if failed.
?>
In this example, after sorting, the first array will transform to "10", 100, 100, 11, "a" (it was sorted as strings in ascending order). The second will contain 1, 3, "2 ", 2, 1 (sorted as numbers, in descending order).
After sorting in this example, the first array will contain 10, 100, 100, "a" (as ascending order of strings), and the second array will contain 1, 3, "2", 1 (as numerically descending order).
Example 2. Sorting multi-dimensional array
In this example, after sorting, the first array will become "10", 100, 100, 11, "a" (treated as strings in ascending order). The second array will contain 1, 3, "2", 2, 1 (treated as numbers in descending order).
For a detailed explanation of the array_multisort() function, please refer to http://www.bKjia.c0m/phper/php-function/39192.htm
http://www.bkjia.com/PHPjc/629150.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629150.htmlTechArticleIn php, array_multisort() can sort multiple arrays at one time, or sort them according to a certain dimension or multiple dimensions. Sort multidimensional arrays, returning TRUE if successful, and FALSE if failed. ...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn