将包含中文的数组按拼音首字母排序

 

   foreach ($array as $key=>$value)
   {
       $new_array[$key] = iconv('UTF-8', 'GBK', $value);
   }
   asort($new_array);
   foreach ($new_array as $key=>$value)
   {
       $array[$key] = iconv('GBK', 'UTF-8', $value);
   }

 

posted @ 2017-11-17 18:43  郁冬  阅读(1283)  评论(0编辑  收藏  举报