Okay, so basically, i’m trying to make a game library from a save file using PHP. Extracting the XML datas provide me with a weird XML file that has 2 <?xml> declaration and i don’t know the most efficient way to deal with it.
Is there a special type of file that can read both or something other than simplexml_load_file to read it successfully ? Or maybe i could read the file first and separate it in 2 differents xml files (i wouldn’t know how atm but i’d work on it)
If anyone know how to deal with it tho i’d love some help !
Haven’t tried much rn, just basic xml outputs with manual extraction of both xml declarations but i’d like to automate it.
2
Answers
Seemed like an error in the file, repeating the xml twice, idk how it works in video games but it's almost the same datas so i'll just delete the second <?xml> using substr and strpos. Thanks for the help, that was a quick one ! :)
You could load the file in and you json_decode to parse the file and its commands, ultimately it depends on what you want to do with the data in the file and what the data represents.