Whats the best xml parser to use especially for XML that's technically invalid format with the <?xml tag missing?
I cant use simpleXML because that gives a error for being invalid. I know i can manually add the tags I need after i get the xml but id prefer to see what you guys think is the best method for parsing a xml into an array in php.
You can use SimpleXML and disable errors by using libxml_use_internal_errors(false);. In case SimpleXML simply won't use your string, I've personally used DOM to parse/fix broken XML before.
On the other hand, why don't you simply add the <?xml characters before reading it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With