I'm parsing an uploaded .csv file, and generating an XML file using a DomDocument in PHP. All is working 100% correctly, wiuth the exception of the very first line of CData that is produced.
If there are 10 lines in the csv, I'm creating 10 lines like the following:
<ItemData>
<DataID>0</DataID>
<Data><![CDATA["Artvan","English","42"]]></Data>
</ItemData>
<ItemData>
<DataID>1</DataID>
<Data><![CDATA["wallace","English","45"]]></Data>
</ItemData>
etc .....
Lines 2 and beyond are perfect, but the DataID=0 always has an odd character in front of the first item. "Artvan" is what should be int he above. Notice DataID 1 is just fine? (as would be every one that comes after ...
I'm using the following to generate this line for every single new DataID as it parses through:
$rec1->appendChild($xml->createCDATASection('"'.trim($element[0]).'","'.trim($element[1]).'","'.trim($element[2]).'"'));
Could this be encoding related? Or something else ? I'm stumped and dont know what to look for.
This is IIS 8.5 with PHP installed , on Windows 2012.
I've not noticed any other issues, with any other parts of the application at all. Just this which is killing me now ;)
Thoughts ?