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
You need to use the attributes()
method to get the results as another class. So, for example, to get the date
attribute:
$myElement->attributes()->date
Also note that it's not a string, it's a SimpleXML attribute. If you want to get its actual value, you need to cast it to string
explicitly:
(string)$myElement->attributes()->date
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.