/ Published in: PHP
URL: http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/
Inside mp3 files there are often some usefull informations stored. Those data are called “id3 tags” and deal with Author name, Title and Album name. There are also some other informations sometimes: such as the length of the track, or the track number of the album, and more, this code will help read those files!
Expand |
Embed | Plain Text
<? // From here: http://www.autistici.org/ermes/index.php?pag=1&post=15 // and fixed here: http://www.barattalo.it // ------------------------------ // example: // print_r( tagReader ("myfile.mp3") ); // ------------------------------ function tagReader($file){ $tmp = ""; $result['FileName'] = $file; } if($result['Version'] == "4.0" || $result['Version'] == "3.0"){ for ($i=0;$i<count($id3v23);$i++){ for ($a=0;$a<strlen($data);$a++){ if($char >= " " && $char <= "~") $tmp.=$char; } $tmp = ""; } } } if($result['Version'] == "2.0"){ for ($i=0;$i<count($id3v22);$i++){ for ($a=0;$a<strlen($data);$a++){ if($char >= " " && $char <= "~") $tmp.=$char; } $tmp = ""; } } } return $result; } ?>
You need to login to post a comment.
