tags:

views:

14

answers:

1

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?

A: 

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.

dkamins