// // available at http://getid3.sourceforge.net // // or http://www.getid3.org // // also https://github.com/JamesHeinrich/getID3 // ///////////////////////////////////////////////////////////////// // // // /demo/demo.simple.php - part of getID3() // // Sample script for scanning a single directory and // // displaying a few pieces of information for each file // // See readme.txt for more details // // /// ///////////////////////////////////////////////////////////////// die('Due to a security issue, this demo has been disabled. It can be enabled by removing line '.__LINE__.' in '.$_SERVER['PHP_SELF']); echo ''; echo 'getID3() - /demo/demo.simple.php (sample script)'; echo ''; echo ''; // include getID3() library (can be in a different directory if full path is specified) require_once '../getid3/getid3.php'; // Initialize getID3 engine $getID3 = new getID3; $DirectoryToScan = '/change/to/directory/you/want/to/scan'; // change to whatever directory you want to scan $dir = opendir($DirectoryToScan); echo ''; echo ''; while (($file = readdir($dir)) !== false) { $FullFileName = realpath($DirectoryToScan.'/'.$file); if ((substr($file, 0, 1) != '.') && is_file($FullFileName)) { set_time_limit(30); $ThisFileInfo = $getID3->analyze($FullFileName); getid3_lib::CopyTagsToComments($ThisFileInfo); // output desired information in whatever format you want echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } echo '
FilenameArtistTitleBitratePlaytime
'.htmlentities($ThisFileInfo['filenamepath']).''.htmlentities(! empty($ThisFileInfo['comments_html']['artist']) ? implode('
', $ThisFileInfo['comments_html']['artist']) : chr(160)).'
'.htmlentities(! empty($ThisFileInfo['comments_html']['title']) ? implode('
', $ThisFileInfo['comments_html']['title']) : chr(160)).'
'.htmlentities(! empty($ThisFileInfo['audio']['bitrate']) ? round($ThisFileInfo['audio']['bitrate'] / 1000).' kbps' : chr(160)).''.htmlentities(! empty($ThisFileInfo['playtime_string']) ? $ThisFileInfo['playtime_string'] : chr(160)).'
'; echo '';