2017 © Pedro Peláez
 

library php-id3

A MP3 ID3 tags reader in native PHP

image

shubhamjain/php-id3

A MP3 ID3 tags reader in native PHP

  • Thursday, September 10, 2015
  • by mhor
  • Repository
  • 4 Watchers
  • 34 Stars
  • 1,964 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 3 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

PHP-ID3

PHP-ID3 makes use of native PHP to read ID3 Tags and thumbnail from a MP3 file. There have been many revisions to ID3 Tags specification; this program makes use of v3.2 of the spec., (*1)

To read binary data more effectively, I have created a sclass, BinaryFileReader, which reads data in named chunks., (*2)

How to Install

Into your composer.json, (*3)

{
    "require" : {
        "shubhamjain/php-id3": "dev-master"
    }
}

How to Use

You will first need to include the autoload.php generated by composer and then you can use the classes in PhpId3 namespace., (*4)

<?php

require 'vendor/autoload.php';

//...
use PhpId3\Id3TagsReader;

//...
$id3 = new Id3TagsReader(fopen("Exodus - 06 - Piranha.mp3", "rb"));

$id3->readAllTags(); //Calling this is necesarry before others

foreach($id3->getId3Array() as $key => $value) {
    if( $key !== "APIC" ) { //Skip Image data
        echo $value["FullTagName"] . ": " . $value["Body"] . "<br />"; 
    }
}

list($mimeType, $image) = $id3->getImage();

file_put_contents("thumb.jpeg", $image ); //Note the image type depends upon MimeType

//...

LICENSE

See LICENSE for more informations, (*5)

Feedback

If you used this project or liked it or have any doubt about the source, send your valuable thoughts at shubham.jain.1@gmail.com., (*6)

The Versions

10/09 2015

dev-master

9999999-dev

A MP3 ID3 tags reader in native PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Shubham Jain

05/01 2014

dev-Writer

dev-Writer

A MP3 ID3 tags reader in native PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Avatar mhor