bool array_multisort ( array ar1 [, mixed arg [, mixed ... [, array ...]]] )
如果成功则返回 TRUE,失败则返回 FALSE。
array_multisort() 可以用来一次对多个数组进行排序,或者根据某一维或多维对多维数组进行排序。
关联(string)键名保持不变,但数字键名会被重新索引。
例子 1. 对多维数组排序
| 代码如下 | 复制代码 |
|
<?php |
|
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).
| 代码如下 | 复制代码 |
|
array(2) { |
|
本例中经过排序后,第一个数组将包含 10,100,100,"a"(作为字符串上升排序),第二个数组将包含 1,3,"2",1(作为数值下降排序)。
例子 2. Sorting multi-dimensional array
| 代码如下 | 复制代码 |
|
<?php |
|
本例中在排序后,第一个数组将变成 "10",100,100,11,"a"(被当作字符串以升序排列)。第二个数组将包含 1, 3, "2", 2, 1(被当作数字以降序排列)。
| 代码如下 | 复制代码 |
| array(2) { [0]=> array(5) { [0]=> string(2) "10" [1]=> int(100) [2]=> int(100) [3]=> int(11) [4]=> string(1) "a" } [1]=> array(5) { [0]=> int(1) [1]=> int(3) [2]=> string(1) "2" [3]=> int(2) [4]=> int(1) } } |
|
实例3 综合实现来看一个关于在应用中常用的实例.
| 代码如下 | 复制代码 |
|
header('Content-Type: text/html; charset=utf-8'); echo ' '; |
|
关于 array_multisort()函数详解可参考 http://www.1*1*1*com.net/phper/php-function/39192.htm
韩剧再婚皇后阿里云盘全集高清1080P资源链接-韩剧再婚皇后免费阿里云盘资源下载4K高清无删减版链接
poipiku网站如何打开-poipiku官网网页版访问入口
明日方舟:终末地-云游戏畅玩入口-明日方舟:终末地-网页版在线直连地址
poki在线小游戏网页版-poki免费游戏大全入口
poki游戏入口-点开即玩-poki游戏-在线免费畅玩
原神akt大佬资源viciNeko入口链接-原神akt大佬资源网页vicineko入口链接分享