Skip to content
Advertisement

How can I rewrite this xml file with the correct encoding using php?

I want to rewrite an xml file without the encoded characters using php.

My xml file looks like this:

JavaScript

How can I fix the issue with the encoded characters? Is there any way I could use php to rewrite the file?

thanks.

EDIT:

This Is my code that takes an xml file, and then splits it into piecies based on how many different order ids there are in the base xml file. The XML above is one of the XMLs that has been proccessed by this code, Why does this code returns those xml files with encoded characters? (The encoded characters are html entities.) .

Heres the CODE:

JavaScript

Advertisement

Answer

Didn’t test it properly but this might work. Didn’t know what kind of result you’re looking for so made it as an simple associative array

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement