Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of adrien gibrat  >  read/write ID3v1  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: example of use
Class: read/write ID3v1
This class can read an write any MP3 ID3v1 tags
Author: By
Last change:
Date: 11 years ago
Size: 817 bytes
 

Contents

Class file image Download
<?
    
function get_filesize($dsize) { 
    if (
strlen($dsize)>=10)
        return 
number_format($dsize/1073741824,1)." Gb";
    elseif (
strlen($dsize)<=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/>';

?>