| // | Allan Hansen | // +----------------------------------------------------------------------+ // | demo.write.apetag.php | // | getID3() demo file - showing how to write APEtags with getID3(). | // +----------------------------------------------------------------------+ // // $Id: demo.write.apetag.php,v 1.3 2006/11/16 22:11:59 ah Exp $ // Enter your filename here $filename = '/data/getid3/test.mp3'; // Include getID3() library (can be in a different directory if full path is specified) require_once('../getid3/getid3.php'); // Include desired writer module require_once('../getid3/write.apetag.php'); // Instantiate desired tag class $tw = new getid3_write_apetag($filename); // Attempt to read current tag if ($tw->read()) { print 'File contains tag already; artist is "' . $tw->comments['artist'] . '"
'; } // Attempt to write new tag -- NOTE: all values must be in UTF-8 try { $tw->comments['artist'] = 'getID3() Testing'; $tw->comments['date'] = array ('1960 (recorded)', '1999 (remastered)'); $tw->write(); print 'New tag written
'; } catch (Exception $e) { print $e->message; } // Attempt to remove tag try { $tw->remove(); print 'Tag removed
'; } catch (Exception $e) { print $e->message; } ?>