nerd4ever/php-id3

ID3 tag reader / writer

1.0.2 2024-02-12 18:03 UTC

This package is auto-updated.

Last update: 2024-04-12 18:27:36 UTC


README

PHP-ID3 is a native php lib for ID3 tags

About This Project

This project is a fork created with the specific purpose of preserving the immutability of the library's code after its official homologation. The creation of this fork serves as a security measure to ensure that, regardless of future updates or changes in the original library, a stable and approved version remains accessible for reference and use.

It is important to highlight that this fork is a direct replica of the main library at the time of its official approval. Therefore, we do not plan to actively make updates or modifications to this repository. The purpose of this fork is purely conservational, ensuring that users can always access the version of the library that was officially approved and validated for use.

Recommendation to Users

We strongly encourage all users and developers interested in the library to use the original version, made available by the creator of the library. Opting for the main library ensures access to the most recent updates, security improvements, bug fixes, and new features that are regularly implemented by the original developer.

To use the original library, please redirect to the repository of the library's creator. There, you will find all necessary documentation, installation guides, and support to ensure a successful implementation of the library in your projects.

Compatibility

PHP-ID3 is tested on the following PHP version :

  • PHP 8.2

Installation

composer install xylphid/php-id3

Usage

PHP Script

Step by step extraction :

use Id3\Id3;

$media = '/path/to/media/file.mp3';
$id3 = new Id3Parser();
$id3->setFilename($media);
$id3->processFile();

Auto process :

$media = '/path/to/media/file.mp3';
$id3 = new Id3Parser($media);

Found tags are registered as object properties and named according to Id3 specifications. You can display tags with :

if ($id3->isCompliant()) {
    printf("Title : %s\n", $id3->getTitle());
    printf("Artist : %s\n", $id3->getArtist());
    printf("Album : %s\n", $id3->getAlbum());
    printf("Track : %s\n", $id3->getTrack());
    printf("PartOfSet : %s\n", $id3->getPartOfSet());
    printf("Genre : %s\n", $id3->getGenre());
    printf("Year : %s\n", $id3->getYear());
    printf("Duration : %s\n", $id3->getDuration())
}