ok first off i extremely new to php. but i understand how to program well...
i understand this code perfectly....and it works perfectly every time..so i try and mod it to fit me needs....
<?php
// include getID3() library (can be in a different directory if full path is specified)
require_once('mp3/getid3/getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
$DirectoryToScan = 'mp3'; // change to whatever directory you want to scan
$dir = opendir($DirectoryToScan);
while (($file = readdir($dir)) !== false) {
$FullFileName = realpath($DirectoryToScan.'/'.$file);
if (is_file($FullFileName)) {
set_time_limit(30);
$ThisFileInfo = $getID3->analyze($FullFileName);
getid3_lib::CopyTagsToComments($ThisFileInfo);
// output desired information in whatever format you want
echo '<TR>';
echo '<TD>'.$ThisFileInfo['filenamepath'].'</TD>';
echo '<TD>'.(!empty($ThisFileInfo['comments_html']['artist']) ? implode('<BR>', $ThisFileInfo['comments_html']['artist']) : ' ').'</TD>';
echo '<TD>'.(!empty($ThisFileInfo['comments_html']['title']) ? implode('<BR>', $ThisFileInfo['comments_html']['title']) : ' ').'</TD>';
echo '<TD ALIGN="RIGHT">'.(!empty($ThisFileInfo['audio']['bitrate']) ? round($ThisFileInfo['audio']['bitrate'] / 1000).' kbps' : ' ').'</TD>';
echo '<TD ALIGN="RIGHT">'.(!empty($ThisFileInfo['playtime_string']) ? $ThisFileInfo['playtime_string'] : ' ').'</TD>';
echo '</TR>';
}
}
?>
i try changing it to this
<?php
// include getID3() library (can be in a different directory if full path is specified)
require_once('mp3/getid3/getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
$DirectoryToScan = 'mp3'; // change to whatever directory you want to scan
$dir = opendir($DirectoryToScan);
while (($file = readdir($dir)) !== false) {
$FullFileName = realpath($DirectoryToScan.'/'.$file);
if (is_file($FullFileName)) {
set_time_limit(30);
$ThisFileInfo = $getID3->analyze($FullFileName);
getid3_lib::CopyTagsToComments($ThisFileInfo);
// output desired information in whatever format you want
echo (!empty($ThisFileInfo['comments_html']['title']) ? implode('<BR>', $ThisFileInfo['comments_html']['title']) : ' ');
}
}
?>
and no all of a suuden it gets really bad...sometimes it works...sometimes i get page cannot be displayed when all ive is deleted some echo statements?