A PHP wrapper for reading and updating ID3 meta data of (e.g.) MP3 files using eyeD3
You need PHP >= 7.0 to use the library, but the latest stable version of PHP is recommended.
- Make sure you have
eyeD3
installed. - Install package
composer require stormiix/php-eyed3 dev-master
This will edit (or create) your composer.json file and automatically choose the most recent version. 3. Require autoload.php
require __DIR__ . '/vendor/autoload.php';
use Stormiix\EyeD3\EyeD3;
$eyed3 = new EyeD3("mp3 file path");
$tags = $eyed3->readMeta();
// $tags is an array that contains the following keys:
// artist, title, album, comment(s), lyrics ..etc
$meta = [
"artist" => "MyArtist",
"title" => "MyTitle",
"album" => "MyAlbum",
"comment" => "MyComment",
"lyrics" => "MyLyrics",
"album_art" => "cover.png"
];
// Update the mp3 file with the new meta tags
$eyed3->updateMeta($meta);
$ phpunit
- Anas Mazouni - php-eyed3
P.S: a similar wrapper exists for NodeJs apps: node-eyed3
This project is licensed under the MIT License - see the LICENSE.md file for details