PHP method to sort a certain key value of a multidimensional array_PHP tutorial
WBOYOriginal
2016-07-13 10:23:30895browse
php method for sorting a certain key value of a multi-dimensional array
PHP multi-dimensional array sorting can be processed with the array_multisort() function. The array_multisort() function can be used to sort multiple items at once. Arrays are sorted, or multi-dimensional arrays are sorted according to a certain dimension or multiple dimensions. The associated (string) key names remain unchanged, but the numeric key names will be re-indexed
In this example, after sorting, the first array will contain "10", "a", 100, 100. The second array will contain 1,1,"2",3. The order of the items in the second array is exactly the same as the order of the corresponding items (100 and 100) in the first array.
But none of these can specify which key value to rank. Below I have compiled a few functions and algorithms, all of which are good.
http://www.bkjia.com/PHPjc/834975.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/834975.htmlTechArticlephp method for sorting a certain key value of a multi-dimensional array. PHP multi-dimensional array sorting can be processed with the array_multisort() function. The array_multisort() function can be used to sort multiple arrays at once,...
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