function loadFilesToArrays(){
$notpromo1Array = simplexml_load_file('pages/hegnar/source/1/notpromo-1_08_04_2013_1.xml');
foreach($notpromo1Array as $xml){
echo $xml -> getName();
echo "<br>";
echo $xml -> ORDREHODE -> SluttkundeNr;
echo "<br>";
}
}
My XML look like this
<?xml version="1.0" encoding="UTF-8"?>
<IS_DATA>
<ORDRER class="linked-list">
<ORDREHODE>
<ORDREKUNDENR>10541</ORDREKUNDENR>
<SluttkundeNr>1240</SluttkundeNr>
<AND OTHER PROPERTIES></AND OTHER PROPERTIES>..........
</ORDREHODE>
<ORDREHODE>
<ORDREKUNDENR>10541</ORDREKUNDENR>
<SluttkundeNr>1344</SluttkundeNr>
<AND OTHER PROPERTIES></AND OTHER PROPERTIES>..........
</ORDREHODE>
<ORDREHODE>
ETC ETC ETC ..................
</ORDREHODE>
</ORDRER>
</IS_DATA>
And the XML is properly ended, etc, I used notepad++'s xml validator.
I don't understand why when I call loadFilesToArray function, I get this error Notice: Trying to get property of non-object in /path/to/file/page1.php on line 104 The IS_DATA is after all enclosed in curly brackets and single quotes as I have seen lots of people referring to when wanting to echo data from XML having special characters in property names in XML.