I have a php-Script, that save some Data into a XML-File. But if two Users save some Data at the same Time, the XML become broken and all Data are lost.
Here is my Code:
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->load($szFile);
... Actions...
$dom->formatOutput = true;
$dom->save($szFile);
Is there a recommend way to save the XML-File without this Problem?