$json = '[{"name":"a1"},{"name":"a10"},{"name":"a12"},{"name":"a3"},{"name":"a5"},{"name":"b21"},{"name":"b2"},{"name":"b11"}]';natsort($json);$data = json_decode($json);foreach ($data as $row) { echo $row->name.'
';//}
$json = '[{"name":"a1"},{"name":"a10"},{"name":"a12"},{"name":"a3"},{"name":"a5"},{"name":"b21"},{"name":"b2"},{"name":"b11"}]';$data = json_decode($json);usort($data, 'cmp');function cmp($a, $b) { if ($a->name == $b->name) return 0; return $a->name > $b->name ? 1 : -1;}foreach ($data as $row) { echo $row->name.'
';//}声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
已抢186218个
抢已抢67149个
抢已抢352753个
抢已抢666796个
抢已抢121611个
抢已抢22591个
抢