Page 1 of 1

plz give me php code for xml file?

Posted: Thu Jan 29, 2009 2:52 am
by gadadasusrikanth
i have the xml file which has to be created at run time. Please give me the php code to generate the exact xml file.

Code: Select all

 
<?xml version="1.0" encoding="UTF-8" ?> 
- <xml>
- <track>
  <path>song1.mp3</path> 
  <title>Track 1 - Track Title</title> 
  </track>
- <track>
  <path>song2.mp3</path> 
  <title>Track 2 - Track Title</title> 
  </track>
- <track>
  <path>song3.mp3</path> 
  <title>Track 3 - Track Title</title> 
  </track>
- <track>
  <path>song4.mp3</path> 
  <title>Track 4 - Track Title</title> 
  </track>
- <track>
  <path>song5.mp3</path> 
  <title>Track 5 - Track Title</title> 
  </track>
 
  </xml>
 
plz help me...........

Re: plz give me php code for xml file?

Posted: Thu Jan 29, 2009 8:11 am
by andym01480
fopen() and fwrite() are good at writing files to the server
variables are pretty good at storing parts of what you want
for loops are pretty good at generating the repetitive bits.

How about having a go and posting some code!

Re: plz give me php code for xml file?

Posted: Thu Jan 29, 2009 8:19 am
by Mark Baker
not to mention simpleXML for generating the XML