How to retrieve data from @ xml attribute in PHP

后端 未结 2 1057
既然无缘
既然无缘 2021-01-26 05:49

Ok so I am stuck with this xml in PHP stuff. I have gotten pretty far considering its my first 3 hours into XML all together ever in my entire life.

I am having trouble

2条回答
  •  广开言路
    2021-01-26 06:06

    Access attributes of an element just as you would elements of an array:

    (string) $xml->property[0]->availability->month[0]['date']

    Edited to add the cast.

提交回复
热议问题