Location: PHPKode > scripts > Read/Write ID3v1 > test.php
<?
	
function get_filesize($dsize) { 
	if (strlen($dsize)>=10)
		return number_format($dsize/1073741824,1)." Gb";
	elseif (strlen($dsize)<=9 and strlen($dsize)>=7)
		return number_format($dsize/1048576,1)." Mb";
	else
		return number_format($dsize/1024,1)." Kb";
} 

require_once('class.id3.php');
	$id3 = new id3("path/to/test.mp3",true);
	echo $id3->id3[artist].'<br/>';
	echo $id3->id3[name].'<br/>';
	echo $id3->id3[album].'<br/>';
	echo $id3->id3[year].'<br/>';
	echo $id3->id3[comment].'<br/>';
	echo $id3->id3[track].'<br/>';
	echo $id3->id3[genre].'<br/>';
	echo $id3->info[mpeg_ver].'<br/>';
	echo $id3->info[layer].'<br/>';
	echo get_filesize($id3->info[filesize]).'<br/>';
	echo $id3->info[length].'<br/>';
	echo $id3->info[bitrate].'<br/>';

	echo $id3->error.'<br/><hr/>';

?>
Return current item: Read/Write ID3v1