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
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
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