array_multisort 对多个数组或多维数组进行排序 说明 boolarray_multisort arrayar1 mixedarg mixed... array... array_multisort 可以用来一次对多个数组进行排序或者根据某一维对多维数组进行排序。排序时保留原有的键名关联。 输入数组被当成一个将以行来排序的表的列 - 这类似于 SQL 的 ORDER BY 子句的功能。第一个数组是要排序的主要数组。 The input arrays are treated as columns of a table to be sorted by rows - this resembles the functionality of SQL ORDER BY clause. The first array is the primary one to sort by. The rows (values) in that array that compare the same are sorted by the next input array, and so on. The argument structure of this function is a bit unusual, but flexible. The very first argument has to be an array. Subsequently, each argument can be either an array or a sorting flag from the following lists. Sorting order flags: SORT_ASC - sort in ascending order SORT_DESC - sort in descending order Sorting type flags: SORT_REGULAR - compare items normally SORT_NUMERIC - compare items numerically SORT_STRING - compare items as strings No two sorting flags of the same type can be specified after each array. The sorting flags specified after an array argument apply only to that array - they are reset to default SORT_ASC and SORT_REGULAR after before each new array argument. &return.success; Sorting multiple arrays In this example, after sorting, the first array will contain 10, "a", 100, 100. The second array will contain 1, 1, "2", 3. The entries in the second array corresponding to the identical entries in the first array (100 and 100) were sorted as well. Sorting multi-dimensional array In this example, after sorting, the first array will contain 10, 100, 100, "a" (it was sorted as strings in ascending order), and the second one will contain 1, 3, "2", 1 (sorted as numbers, in descending order).