Page 1 of 1

Create xml file from raw xml

Posted: Tue Apr 21, 2009 1:23 am
by shahab74
Hi I am very new to PHP but would like to create a xml file by pushing in the data from another page.The XML data is as a string but when I try to write toa file it inserts "\" after every empty space. Could anyone please guide me in the right direction.
thanks in advance:

my xml data is like this:

Code: Select all

<?xml version="1.0"?><tree id="0"><item id="books"  open="1"  text="List" im0="iconReport.gif" im1="iconReport.gif" im2="iconReport.gif" ><item id="1206519292232"  open="1"  text="Fresh Produce" im0="leaf.gif" im1="folderOpen.gif" im2="folderClosed.gif" ><item id="1206617842239"  text="Bananas" im0="book.gif" im1="books_open.gif" im2="book.gif" ></item><item id="1206617846798"  text="Tomatoes" im0="book.gif" im1="books_open.gif" im2="book.gif" ></item><item id="1206617858038"  text="Carrots Little Red Ones" im0="book.gif" im1="books_open.gif" im2="book.gif" ></item></item><item id="1206519301435"  open="1"  select="1" text="Delicatessen" im0="leaf.gif" im1="folderOpen.gif" im2="folderClosed.gif" ><item id="1206617888985"  text="Roast Lamb Slices 100 Grm" im0="book.gif" im1="books_open.gif" im2="book.gif" ></item><item id="1240294340708"  text="Trruyytu" im0="book.gif" im1="books_open.gif" im2="book.gif" ></item></item><item id="1206519320717"  text="Fresh Meat" im0="leaf.gif" im1="folderOpen.gif" im2="folderClosed.gif" ></item></item></tree>