排序.我想下面的数组以cat_name来排序

WBOY
Release: 2016-06-23 13:58:10
Original
1024 people have browsed it

Array
(
[1] => Array
(
[cat_id] => 1
[cat_name] => Other
)

[2827511014] => Array
(
[cat_id] => 2827511014
[cat_name] => mobile phone housing
)

[2827513014] => Array
(
[cat_id] => 2827513014
[cat_name] => mobile phone other accessories
)

[2827516014] => Array
(
[cat_id] => 2827516014
[cat_name] => PC Accessories
)

[2827518014] => Array
(
[cat_id] => 2827518014
[cat_name] => Electronics
)

[3089502014] => Array
(
[cat_id] => 3089502014
[cat_name] => Jewelry Accessories
[child] => Array
(
[3089509014] => Array
(
[cat_id] => 3089509014
[cat_name] => Necklace
)

[3089510014] => Array
(
[cat_id] => 3089510014
[cat_name] => Earrings
)

[3158873014] => Array
(
[cat_id] => 3158873014
[cat_name] => headband
)

)

)

。。。。。。


回复讨论(解决方案)

$a = 你的数组;foreach($a as $r) $b[] = $r['cat_name'];array_multisort($b, $a);
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!