按首字母重组数组排序
//压入首字母
foreach ($res as $k => $v)
{
$res[$k]['first'] = strtoupper(substr(trim($v['name']), 0, 1));
$arr = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
//如果不是字母 把他规划到0-9队列
if (!in_array($res[$k]['first'], $arr))
{
$res[$k]['first'] = '0-9';
}
}
foreach ($res as $k => $v)
{
$result[$v['first']][] = $v;
}
ksort($result);