母 // Press the first letter 压 Foreach ($ res as $ k = & gt; $ 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');
// If it is not a letter, plan him to 0-9 queue
if (! In_array ($ res [$ k] ['first'], $arr))
)
$v['first']][] = $v;
$v;