Blogger Information
Blog 20
fans 0
comment 0
visits 14716
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
usort()二维数组的排序 2018.8.27
李逍遥
Original
691 people have browsed it

实例

//usort多维数组的排序

$b = [
    ['name'=>'王宝强','age'=>'32'],
    ['name'=>'鹿晗','age'=>'28'],
    ['name'=>'王俊凯','age'=>'20'],
];
usort($b,function ($u,$i){
    return strcmp($u['age'],$i['age']);
});
echo var_export($b);

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post