need php script to generate a xml file with music info.

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
awhite92
Forum Newbie
Posts: 4
Joined: Sat May 09, 2009 5:00 pm

need php script to generate a xml file with music info.

Post by awhite92 »

Hi,
OMG! I've been looking everywhere for help on making a php script that will create a xml file that looks something like this:

Code: Select all

 
<artists>
  <artist value="Jack Johnson">
    <album value="Greatest Hits">
      <song value="Banana Pancakes">
        <location>location/to.file</location>
      </song>
      <song value="song 2">
        <location>location/to.file</location>
      </song>
    </album>
    <album value="other album">
      <song value="song1">
        <location>location/to.file</location>
      </song>
      <song value="song 2">
        <location>location/to.file</location>
      </song>
    </album>
  </artist>
  <artist value="Metallica">
  ...
  </artist>
</artists>
 

i cant do this by hand cuz i got about 15 or so Gigs of songs.
i need this to use in a web music player i'm creating on my server for me and my brother to use.
and this is my first time going to a forum for help, i love doing stuff on my own, but this i can't seem to do.

any help would be Greatly Appreciated...
Last edited by awhite92 on Sat May 09, 2009 10:16 pm, edited 2 times in total.
Defiline
Forum Commoner
Posts: 59
Joined: Tue May 05, 2009 5:34 pm

Re: need php script to generate a xml file with music info.

Post by Defiline »

awhite92
Forum Newbie
Posts: 4
Joined: Sat May 09, 2009 5:00 pm

Re: need php script to generate a xml file with music info.

Post by awhite92 »

thx for the quick response Defiline,
but i'm still having trouble figuring out how to create the php script...
awhite92
Forum Newbie
Posts: 4
Joined: Sat May 09, 2009 5:00 pm

Re: need php script to generate a xml file with music info.

Post by awhite92 »

Ok I just wrote a script that will index the location to all of the files in my music/* Directory and sub folders.

now all i need a script that will separate all of them by artists >album > song in an xml file like the one in my original post for easy access in my music player.

any Ideas?
awhite92
Forum Newbie
Posts: 4
Joined: Sat May 09, 2009 5:00 pm

Re: need php script to generate a xml file with music info.

Post by awhite92 »

I have a list of file locations to mp3 files, i want to run through that and turn it in to a XML file like the one above...
:banghead: I don't know what to do now...
Post Reply