a problem looping
Posted by: memco
Posted on: 2006-12-14 13:36:00
$getID3 = new getID3;
$dir = 'sermons';
$result = scandir ($dir);
foreach ($result as $file) {
echo 'scanning
';
print "$file";
$fileinfo = $getID3->analyze($file);
$title = $fileinfo['id3v2']['comments']['title'][0];
echo ($title);
}
I seem to be hitting a problem in this code wherein the foreach loop does not iterate through every element of $result. It stops after the first file, which is ".". All I'm really after is the $title variable for all files in a directory, but I'm having problems isolating those.