【发布时间】:2015-03-20 16:32:16
【问题描述】:
我有一个 SimpleXMLElement 对象:
SimpleXMLElement Object (
[@attributes] => Array (
[id] => 1234
[color] => red
)
[one] => SimpleXMLElement Object (
[@attributes] => Array (
[position] => 2
[close] => false
)
)
[two] => SimpleXMLElement Object (
[@attributes] => Array (
[position] => 0
[close] => false
)
)
[three] => SimpleXMLElement Object (
[@attributes] => Array (
[position] => 0
[close] => true
)
)
)
现在我想按属性“位置”对孩子(“一”、“二”、“三”)进行排序。 我该如何解决这个问题?
谢谢!
【问题讨论】:
-
您好,请看这里。你将不得不使用
array_multisort函数php.net/manual/en/function.array-multisort.php
标签: php arrays xml object simplexml