无法找到正确的函数来对多维数组进行排序,如下所示:
Array( [0] => Array (
[username] => 123
[name] => Name
[address] => array (
[line1] => address line 1
[line2] => address line 2
[postcode] => postcode
),
[1] => Array (
[username] => 1234
[name] => Name
[address] => array (
[line1] => address line 1
[line2] => address line 2
[postcode] => postcode
)
)
我希望通过地址数组()中的一个元素对上述数组进行排序。
我知道 array_multisort 函数可以很容易地按用户名或地址排序,但无法弄清楚如何使用另一个级别的字段进行排序。
任何帮助将非常感激
谢谢