We apologize for the interruption. However, seabreezecomputers.com has been offering free tools and downloads for many years. Unfortunately, server expenses are now starting to exceed revenue earned. If you appreciate the free tools and downloads at seabreezcomputers.com please consider making a donation.
I created this PHP script to read the ID3 tag from MP3 files because I did not like having to install the PECL id3 library to use the id3_get_tag() function in PHP. Also many programmers have found it confusing to install the PECL id3 library. There are many forums with Fatal error: Call to undefined function: id3_get_tag() with no one giving complete instructions on how to fix the error. Also many other PHP libraries or functions on the Internet for getting mp3 id3 tags were either too big and messy, undocumented or uncommented, or incomplete (not able to read ID3v1 and ID3v2 tags) or incorrect.
Features of this PHP script:
Also the following custom tags are created for convenience:
You can add more ID3 tags to the $tags_array() if you know the tag abbreviation and tag name which you can find at the following reference sites:
Please make a donation to reveal the download link.
3/26/2019 - Version 2.0d - Fixed "warning: undefined variable" if PHP is set to display warnings.
7/6/2017 - Version 2.0c - Bug Fix: Comments were possibly not displaying correctly for some MP3 files because ID3v2.3 tags and ID3v2.4 tags use four letter abbreviations and ID3v2.2 tags use three letter abbreviations. Instead of putting them in the same array on line 35, the array has been split in to two on line 48 depending on the ID3 tag version.
4/18/2016 - Version 2.0b - Bug Fix: If PHP is set to display warnings then get "Variable $bits undefined on line 91" warning. Fixed by declaring variable $bits on line 84. Also undefined constant warning on line 113. Fixed by commenting line 112 and 113 because they were no longer being used. It was an old way to get formatted_time.
11/30/2015 - Version 2.0a - Bug Fix: Minor bug with getting correct bitrate and duration with some MP3 files and causing a Division by zero error in PHP. Fixed with line 61 by removing 10 + before total_size in the stream_get_contents statement.
10/19/2015 - Version 2.0 - Major Changes: Now the script can read mp3s on remote servers and not just the same server the script is on. Major bug fixes: There were many bugs with getting the bitrate, duration, etc. from some versions of mp3 files. Those bugs seem to have been fixed.
12/17/2014 - Version 1.0b - Bug Fix: Forgot to remove an echo for testing on line 102
12/12/2014 - Version 1.0 - Created function mp3_get_tags()