Raczkuję w PHP; czy ktoś podpowie mi jak zabrać się za wyciąganie danych z takiego pliku txt:
Kod
# xmcd CD database file
#
# Track frame offsets:
# 150
# 22823
# 35562
# 53667
# 73763
# 89265
# 109452
# 122224
# 143059
# 155970
#
# Disc length: 2286 seconds
#
# Revision: 0
# Processed by: cddbd v1.5.2PL0 Copyright (c) Steve Scherf et al.
# Submitted via: CDex 1.70beta2
#
DISCID=8c08ec0a
DTITLE=Arcana / Raspail
DYEAR=2008
DGENRE=Darkwave
TTITLE0=Abrakt
TTITLE1=Sight of Relief
TTITLE2=Invisible Motions
TTITLE3=Outside Your World
TTITLE4=Parisal
TTITLE5=Autumnal
TTITLE6=Out of the Grey Ashes
TTITLE7=Lost in Fire
TTITLE8=Remembrance
TTITLE9=Circumspection
EXTD= YEAR: 2008
EXTT0=
EXTT1=
EXTT2=
EXTT3=
EXTT4=
EXTT5=
EXTT6=
EXTT7=
EXTT8=
EXTT9=
PLAYORDER=
#
# Track frame offsets:
# 150
# 22823
# 35562
# 53667
# 73763
# 89265
# 109452
# 122224
# 143059
# 155970
#
# Disc length: 2286 seconds
#
# Revision: 0
# Processed by: cddbd v1.5.2PL0 Copyright (c) Steve Scherf et al.
# Submitted via: CDex 1.70beta2
#
DISCID=8c08ec0a
DTITLE=Arcana / Raspail
DYEAR=2008
DGENRE=Darkwave
TTITLE0=Abrakt
TTITLE1=Sight of Relief
TTITLE2=Invisible Motions
TTITLE3=Outside Your World
TTITLE4=Parisal
TTITLE5=Autumnal
TTITLE6=Out of the Grey Ashes
TTITLE7=Lost in Fire
TTITLE8=Remembrance
TTITLE9=Circumspection
EXTD= YEAR: 2008
EXTT0=
EXTT1=
EXTT2=
EXTT3=
EXTT4=
EXTT5=
EXTT6=
EXTT7=
EXTT8=
EXTT9=
PLAYORDER=
... aby na stronie wyświetlić ładnie dane płyty w sposób mniej więcej taki:
Cytat
WYKONAWCA - Arcana
TYTUŁ - Raspail
ROK - 2008
TT - 2286 sek (zamieniam na H:S)
TYTUŁY UTWORÓW:
TYTUŁ - Raspail
ROK - 2008
TT - 2286 sek (zamieniam na H:S)
TYTUŁY UTWORÓW:
- Abrakt
- Sight of Relief
- Invisible Motions
- Outside Your World
- Parisal
- Autumnal
- Out of the Grey Ashes
- Lost in Fire
- Remembrance
- Circumspection
(itd)
poniżej byłaby recenzja.
Bazę MySQL wyobrazam sobie mniej wiecej tak:
Kod
CREATE TABLE `muzyka_cd` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`cddb` varchar( 50 ) NOT NULL ,
`wykonawca` varchar( 200 ) NOT NULL default '',
`album` varchar( 200 ) NOT NULL default '',
`gatunek` varchar( 50 ) NOT NULL default '',
`okladka` varchar( 100 ) NOT NULL default '',
`muzycy` text NOT NULL ,
`recenzja` text NOT NULL ,
`data` date NOT NULL default '0000-00-00',
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT AUTO_INCREMENT =1;";
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`cddb` varchar( 50 ) NOT NULL ,
`wykonawca` varchar( 200 ) NOT NULL default '',
`album` varchar( 200 ) NOT NULL default '',
`gatunek` varchar( 50 ) NOT NULL default '',
`okladka` varchar( 100 ) NOT NULL default '',
`muzycy` text NOT NULL ,
`recenzja` text NOT NULL ,
`data` date NOT NULL default '0000-00-00',
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT AUTO_INCREMENT =1;";
Generalnie jestem w stanie to zrobić... ale nie wiem jak zabrać się za wyciąganie danych z plików o takiej strukturze.
Pliki będą pobierane z freedb.org, tu jest oryginał: http://www.freedb.org/freedb/misc/8c08ec0a
Proszę o podpowiedzi :-)
Pozdrawiam