require_once '../getid3/getid3.php'; // Include desired writer module require_once '../getid3/write.lyrics3.php'; // Instantiate desired tag class $tw = new getid3_write_lyrics3($filename); // Attempt to read current tag if ($tw->read()) { print 'File contains tag already; artist is "' . $tw->artist . '"<br>'; } // Attempt to write new tag -- NOTE: all values must be in ISO-8859-1 try { $tw->title = 'A new title'; $tw->artist = 'A new artist'; $tw->album = 'A new album'; $tw->author = 'A new author'; $tw->comment = 'A new comment'; $tw->images = 'image.jpg'; $tw->synched = true; $tw->lyrics = "[00:02]Let's talk about time\r\n[00:02]tickin' away every day\r\n[00:05]so wake on up before it's gone away\r\n"; $tw->write(); print 'New tag written<br>'; } catch (Exception $e) { print $e->message; } // Attempt to remove tag try { $tw->remove(); print 'Tag removed<br>'; } catch (Exception $e) { print $e->message; }