I have this XML
<STOREITEMS>
<CREATED value="Tue Oct 9 5:30:01 BST 2012">
<CATEGORY id="442" name="Hen And Stag Nights"></CATEGORY>
<CATEGORY id="69" name="Games"></CATEGORY>
<CATEGORY id="252" name="Love Zone"></CATEGORY>
<CATEGORY id="202" name="Spotlight Items"></CATEGORY>
</CREATED>
</STOREITEMS>
I need to get the Category - name attribute with PHP
So far I have this
$xml = simplexml_load_file("http://www.dropshipping.co.uk/catalog/xml_id_multi_info.xml");
foreach($xml->CATEGORY['name']->attributes() as $category)
{
echo $category;
}
This however returns Fatal error: Call to a member function attributes() on a non-object
Any ideas? Thank you.