Hi
I know that this question have been asked many times before, but I can't seem to find the exact answer for my need.
What is the best way to create a xml document from php?
I have read about several solutions, some does not actually create the file but only shows the xml code on the screen, I think I need a fysical xml file because i need to use the data in actionscript later on.
Then there's DOM which I can't figure out if I am supposed to install on my server(not my own server, just some random standard web server) or how it is used.
Hope someone can clear things up for me.
Thanks
Deepcover
create xml document from php
Moderator: General Moderators
- Grizzzzzzzzzz
- Forum Contributor
- Posts: 125
- Joined: Wed Sep 02, 2009 8:51 am
Re: create xml document from php
if you're getting the entire XML written on the screen, then you're already 99% of the way there.
Simply take the string that's being outputted, and write it to a file
Simply take the string that's being outputted, and write it to a file
Code: Select all
$myFile = "test.xml";
$fh = fopen($myFile, 'w');
$stringData = "alllllllll your XML";
fwrite($fh, $stringData);
fclose($fh);