【发布时间】:2017-06-18 18:17:52
【问题描述】:
[0] => Array (
[term] => punk
[term_html] => <a href=""> punk </a>
)
[1] => Array (
[term] => conflict
[term_html] => <a href=""> conflict </a>
)
[2] => Array (
[term] => Crass
[term_html] => <a href=""> Crass </a>
)
[3] => Array (
[term] => bct 2
[term_html] => <a href="">
)
如何根据数组内数组的“术语”按字母顺序对该数组进行排序?
我试过这个:
function sortByOrder($a, $b) {
return $search_terms_html[term];
}
uasort($search_terms_html, 'sortByOrder');
但它不起作用:(
【问题讨论】:
-
uksort(); .......
-
刚刚用 uksort() 测试过...同样的结果