I have question on XML Manipulation in PHP.
So I have a requirement to parse a xml file and then display it on the website, these are not difficult. But then, I will need to let the user edit the field in xml in forms. Basically, I grouped the xml file into four tables, each table has add,delete edit functionality.
The way I did it was each time the user submit the form, I open up the XML, read it in using fopen, then find the location for delete, add or edit, then store it as a new file, then delete the original file. This process works ok, but involves lots of I/O handling and if the user do the form update fast, it will simply crush, with the error, file in use or cannot find file or something.
Why don’t you use simpleXML extension for that purpose? Maybe you should store your xml files in DB :
So you will just need to read the xml file from table and then (when user will modify it) just update record.