/**
* 将数组按字母A-Z排序
* @return [type] [description]
*/
public function chartSort($user){
foreach ($user as $k => &$v) {
$v['chart']=$v['initial'];
}
$data=[];
foreach ($user as $k => $v) {
if ( empty( $data[ $v['chart'] ] ) ) {
$data[ $v['chart'] ]=[];
}
$data[ $v['chart'] ][]=$v;
}
ksort($data);
return $data;
}
temp是个二维数组。其中initial是这个数组里面的首字母