Just a small problem but I’ve noticed that if first line of my xml has encoding="Latin-1" then the php simplexml and dom will throw an error and refuse to import. I did a workaround in which I’d import the xml as a string and regex encoding="Latin-1" into encoding="ISO-8859-1" before loading into the object which then doesn’t throw an error, but I was wondering if there’s a more elegant solution to this? Preferably something internal to the dom object so I can just import from file name.
Just a small problem but I’ve noticed that if first line of my xml
Share
For anyone interested, this is the code for the workaround: