has a two-dimensional array
usersname
ask for advice from God
function multi_array_sort ($multi_array,$sort_field,$sort_type = SORT_ASC) {
if(empty($multi_array))
return false;
$arr_field = array();
foreach($multi_array as $row) {
if(empty($row))
return false;
array_push($arr_field,$row[$sort_field]);
}
array_multisort($arr_field,$sort_type,$multi_array);
return $multi_array;
}
$default ['users'] = multi_array_sort ($default [' users'], 'name',SORT_DESC);
print_r ($default);
order of transcoding required in Chinese is attached
function array_sort($arrays,$sort_key,$sort_order=SORT_ASC,$sort_type=SORT_NUMERIC ){
if(is_array($arrays)){
foreach ($arrays as $array){
if(is_array($array)){
$key_arrays[] = iconv('utf-8', 'GB2312//IGNORE', $array[$sort_key]);
}else{
return false;
}
}
}else{
return false;
}
array_multisort($key_arrays,$sort_order,$sort_type,$arrays);
return $arrays;
}