Sort object(SimpleXMLElement) php

后端 未结 4 1439
北荒
北荒 2020-12-22 04:23

I\'m trying to find a way to sort my array from SimpleXMLElement. I\'d like to sort by start time which I can get from event_start_dt. I\'d also like to sort by room ID as a

4条回答
  •  情深已故
    2020-12-22 05:17

    You have to convert frist in to xml to array using json encode decode

    $xml_array = json_decode(json_encode((array)$xml), TRUE);

    u will get list of array....than u can sory according to date using strtotime function.

提交回复
热议问题