Re[2]: [PHP-DEV] Parsing File Names

2002-03-03 Thread Daniel Lorch
hi, > $handle=opendir('/path/to/files'); > while (false !== ($file = readdir($handle))) { > if (preg_match("/(.*) - (.*).mp3/i", $file, $matches)) { > $artist = $matches[1]; > $song = $matches[2]; > // insert into db > } > } ?>> I'd suggest to write it like t

RE: [PHP-DEV] Parsing File Names

2002-02-28 Thread Chris Newbill
lto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:34 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] Parsing File Names I am trying to create a script that will crawl through a directory, take each file name, and parse it to get information from the filename. This is going to be used to place ar

[PHP-DEV] Parsing File Names

2002-02-28 Thread Jason Dubya
I am trying to create a script that will crawl through a directory, take each file name, and parse it to get information from the filename. This is going to be used to place artists and song names into a database. The filenames are all in the following format: artist - songname.mp3 Is there an