Jump to content


Photo

Problem to read ID3 tags from MP3...


  • Please log in to reply
No replies to this topic

#1 LegendBreath

LegendBreath
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationNew Brunswick, Canada

Posted 15 May 2006 - 10:21 PM

Hey,
I got some problems to read the ID3 tags from my MP3's tags, strangly, for some mp3 it works and for some it doesn't. Here is a screenshot (Path, Artist, Album, Title).

[a href=\"http://xs.to/xs.php?h=xs100&d=06202&f=Untitled-5.jpg\" target=\"_blank\"][img src=\"http://xs100.xs.to/xs100/06202/Untitled-5.jpg.xs.jpg\" border=\"0\" alt=\"IPB Image\" /][/a]

The thing is that I want to remove those squares, before there was "ÿþ" symbols but I removed them.
Here is my code:
            $path = $_GET["path"];
            $i = 0;
            
            require('id3.class.php');
            $myId3 = new ID3($mp3);
            
            $files = filelist($path, 1, 0);
            foreach ($files as $list) {
                if (ereg (".mp3", $list['name'])) {
                   $mp3 = $list['path'].$list['name'];
                   $myId3->ID3($mp3);
                   
                   if ($myId3->getInfo()){
                           $artist = str_replace("ÿþ", "", $myId3->getArtist());
                        $album = str_replace("ÿþ", "", $myId3->getAlbum());
                        $title = str_replace("ÿþ", "", $myId3->getTitle());
                        echo $list['path'].$list['name']." ".$artist." ".$album." ".$title.'<br>';
                   }else{
                        echo '<font color="red">'.$list['path'].$list['name'].'</font><br>';    
                   }
                   
                   $mp3array[$i] = $list['path'].$list['name'];
                   $i++;
                }
            }

Can someone help me?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users