Simple XML Parsing XML Attributes
I have an XML file with data stored like this:
<myxml> <item name="column18">88744544</item> <item name="column11">47884994</item> <item name="column3">44788894</item> </myxml> I need to first check (and make sure) that column11 is defined (there is no specific order), and then get its value.
Using plain XML does not work.
I have the following, but the value is missing.
<?php if (count($xml->myxml->item) > 0) { foreach ($xml->myxml->item as $item) { var_dump($item->attributes()); } } ?> $ item-> attributes () → column11 does not work.
+4
2 answers