数组按照alphabet序排序

数组key按照alphabet序排序
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  
/**
* @FuncName:arraySoft
* @Description 数组key按照alphabet序排序
* @User ZHaoGuiBin
* @Date 2020-08-13 15:45
* @param $data
* @return mixed
*/
private static function arraySoft($data)
{
ksort($data);
foreach ($data as $key => $value) {
if (is_array($value)) {
$data[$key] = self::arraySoft($value);
}
}
return $data;
}