I've got broken data.xml file, how i can fix it with php? I need to add at the beginning of the file two lines
<?xml version="1.0" encoding="UTF-8"?>
<archive>
...<xml data>...
And at the end of the file
</archive>
Does anyone have any ideas or solutions how to 开发者_运维问答add and save xml structure?
This is sort of an incomplete questions... Are you writing a script to run on the command-line and work with files? Handling uploaded files?
In general just treat the file as a text file. You can make a new file, write your new first two lines, then output the contents of your data.xml file, then write the last line. It's just text.
精彩评论