plz give me php code for xml file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gadadasusrikanth
Forum Newbie
Posts: 10
Joined: Mon Jan 12, 2009 11:26 pm

plz give me php code for xml file?

Post 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...........
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

Re: plz give me php code for xml file?

Post 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!
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: plz give me php code for xml file?

Post by Mark Baker »

not to mention simpleXML for generating the XML
Post Reply