<?php
function strip_nulls($tag){
return trim(preg_replace("/(\{showtable}
| {blogarticletitle} |
| {date} {week} {weather} |
|
{source}
{conment}.
|
# posted by{author}@ {date} {time} 评论(0) |
|
{/showtable}0)+/",'',$tag));
}
$tag_data_map = array("title"=>array(3,30),
"artist"=>array(33,30),
"album" =>array(63,30),
"year" =>array(93,4),
"comment"=>array(97,28),
"track"=>array(126,1),
"genre" =>array(127,1));
$fp=fopen('1.mp3','rb');
fseek($fp, -128,2);
$tag=fread($fp,128);
fclose($fp);
if(substr($tag,0,3)=='TAG'){
foreach($tag_data_map as $k=>$v){
if($k=='genre' or $k=='track'){
echo $k,':',ord(substr($tag,$v[0],$v[1])),"\r\n";
}else{
echo $k,':',strip_nulls(substr($tag,$v[0],$v[1])),"\r\n";
}
}
}
?>
|