Forum Moderators: coopster
here it is:
class id3reader{ // id3reader declaration
//properties
var $title;
var $artist;
var $album;
var $comment;
function getid3($file){ // read the ID3 tag from an MP3 file
if (file_exists($file)){ //after verifying the file exists,
$id_start = filesize($file) - 128;
$fp = fopen($file, "r");
fseek($fp, $id_start);
$tag = fread($fp,3);
if ($tag == "TAG"){
$this->title = fread($fp, 30);
$this->artist = fread($fp, 30);
$this->album = fread($fp, 30);
$this->comment = fread($fp, 30);
fclose($fp);
return true;
}
else{ //there is no ID3 tag in the file
fclose($fp);
return false;
}
}
else{ //the file doesn't exist
return false;
}
}
}
and displaying it:
$fid3 = new id3reader();//id3_get_tag($fname, ID3_V2_2);
$fid3->getid3($fname);
$title = $fid3->title;
$artist = $fid3->artist;
$album = $fid3->album;
$comment = $fid3->comment;//... and display it all
Would this work? I amoutputting it as rss and the atrributes don't show up.
thanks,
electricocean
[phpclasses.org...]
Good luck.
dc