Garethp Posted May 30, 2009 Share Posted May 30, 2009 Ok, so I just started with ID3 fucntions, and here's my code <?php $File = "Love is War.mp3"; $Tags = id3_get_tag($File); print_r($Tags); $data = array( "title" => "Re:Start", "artist" => "Re:\Legion", "comment" => "A nice track" ); $result = id3_set_tag($File, $data); $Tags = id3_get_tag($File); print_r($Tags); ?> The problem being that the tags don't change at all, any help? Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/ Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 Do you get an error or anything? You should put some kind of check to make sure that it worked. eg: $result = id3_set_tag($File, $data); if($result) { echo 'It was successful'; } else { echo 'something went wrong'; } Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845637 Share on other sites More sharing options...
waynew Posted May 30, 2009 Share Posted May 30, 2009 Is this file writable? Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845639 Share on other sites More sharing options...
Garethp Posted May 30, 2009 Author Share Posted May 30, 2009 It was successful with no errors, but the tag still remains the same, and yes, the file is writeable, atleast, using the Windows console. How do I check if it's writeable with PHP? Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845640 Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 It was successful with no errors, but the tag still remains the same, and yes, the file is writeable, atleast, using the Windows console. How do I check if it's writeable with PHP? http://us3.php.net/manual/en/function.fileperms.php Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845641 Share on other sites More sharing options...
Garethp Posted May 30, 2009 Author Share Posted May 30, 2009 I get -rw-rw-rw- With <?php $perms = fileperms('Love is War.mp3'); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); echo $info; ?> Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845642 Share on other sites More sharing options...
waynew Posted May 30, 2009 Share Posted May 30, 2009 1: Do you have error_reporting on? 2: Do you have the relevant package installed? See here. Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845643 Share on other sites More sharing options...
Garethp Posted May 30, 2009 Author Share Posted May 30, 2009 error_reporting is set to E_ALL and I have got it installed, because before I enabled it, it said that the functions where not defined or something, now there's no error Link to comment https://forums.phpfreaks.com/topic/160252-id3-problems/#findComment-845644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.