Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 排序simpleXML对象_Php_Xml_Codeigniter - Fatal编程技术网

Php 排序simpleXML对象

Php 排序simpleXML对象,php,xml,codeigniter,Php,Xml,Codeigniter,我对simplexmlement对象的数组排序有问题。数据如下: [ServiceHotel] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [availToken] => 0 ) ) [1] => SimpleXMLElement Object ( [@attribu

我对
simplexmlement
对象的数组排序有问题。数据如下:

[ServiceHotel] => Array
(
  [0] => SimpleXMLElement Object
    (
      [@attributes] => Array
        (
          [availToken] => 0
        )
    )
  [1] => SimpleXMLElement Object
    (
      [@attributes] => Array
        (
          [availToken] => 1
        )
    )
  [2] => SimpleXMLElement Object
    (
    [@attributes] => Array
        (
          [availToken] => 2
        )
    )
  [3] => SimpleXMLElement Object
    (
      [@attributes] => Array
        (
          [availToken] => 3
        )
    )
)

我想按PHP中的
availToken
对数据进行排序。有人能帮我吗?

可能重复的感谢问题@rafael这是一个解决方案