Hey all,
I am very new to php so take that into account. I want to make a php script that will load a .m3u playlist file which has been created my winamp (preuploaded to the server manually) and parse out that data into a mySQL database. As far as I know an m3u file has 3 things it stores:
1)The length of the mp3 in seconds
2)The artist name - track name based on the id3 tag
3)The path to the file
Here is an example listing:
#EXTINF:103,Weezer - Porcupine
!Audio\Weezer\WEEZER-2002-01-06_05Porcupine_340.mp3
It always starts with "#EXTINF:" then the length of the song followed immediatelly by a comma. Immediatelly following the comma is the artist name and track name. Then after a carriage return is the file path. Then another carriage return and the process repeats itself.
So, I was thinking it would be fairly easy to have a php script identify each seperate piece and then put it into a mySQL table containing 5 columns:
1) Row-id (i.e. how far down on the playlist is it)
2) Length
3) Artist Name
4) Track Name
5) File Path
Noticing I want to seperate the artist name and track name. Any help would be greatly appreciated. Once I have that into a mySQL database I know how to query it. THANKS!
-Evan Robinson