News新闻

业界新闻动态、技术前沿
Who are we?

您的位置:首页      乐道系统FAQ      PHP实现获取第一个中文首字母并进行排序的方法

PHP实现获取第一个中文首字母并进行排序的方法

发布日期:2017-05-09 00:00:00 55

本文实例讲述了PHP实现获取第一个中文首字母并进行排序的方法。分享给大家供大家参考,具体如下:

最近在做储值结算,需求里结算首页需要按门店的首字母A-Z排序。我的数据结构原本是这样的:

Array
(
  [0] => Array
    (
      [sid] => 2885842
      [recetcstoredpay] => 24000
      [recetclprinciple] => 23465
      [paytcstoredpay] => 5455
      [paytclprinciple] => 34900
      [sname] => 百宴餐饮---便宜坊烤鸭店
    )
  [1] => Array
    (
      [sid] => 3644191
      [recetcstoredpay] => 89200
      [recetclprinciple] => 406930
      [paytcstoredpay] => 4090
      [paytclprinciple] => 97800
      [sname] => 大长秋餐饮中心
    )
  [2] => Array
    (
      [sid] => 5229673
      [recetcstoredpay] => 26000
      [recetclprinciple] => 45930
      [paytcstoredpay] => 24795
      [paytclprinciple] => 121800
      [sname] => 大众点评网
    )
  [3] => Array
    (
      [sid] => 3715927
      [recetcstoredpay] => 13600
      [recetclprinciple] => 56930
      [paytcstoredpay] => 5710
      [paytclprinciple] => 37800
      [sname] => 江东北路店
    )
  [4] => Array
    (
      [sid] => 3671092
      [recetcstoredpay] => 1280
      [recetclprinciple] => 46930
      [paytcstoredpay] => 128090
      [paytclprinciple] => 149800
      [sname] => 金凤区新馆
    )
  [5] => Array
    (
      [sid] => 1858783
      [recetcstoredpay] => 2040
      [recetclprinciple] => 4465
      [paytcstoredpay] => 245
      [paytclprinciple] => 4900
      [sname] => 浙江西子宾馆
    )
  [6] => Array
    (
      [sid] => 16832117
      [recetcstoredpay] => 81600
      [recetclprinciple] => 470930
      [paytcstoredpay] => 506090
      [paytclprinciple] => 8000
      [sname] => 欢乐谷店
    )
)