View Full Version : ID3 v2

06-16-2006, 10:35 AM
Hey! I can set the id3v1 info with the function id3_set_tag() in php. But does anyone know how to set the v2 tags? I need this to be done on a webserver before outputting a mp3 file.


Curtis D
06-16-2006, 10:59 AM

It says right there in the manual, that you can set ID3 version tags.

06-16-2006, 11:09 AM
Note: Currently id3_set_tag() only supports version 1.0 and 1.1.

I want to set version 2 tags.

06-16-2006, 02:39 PM
I found this: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=710&lngWId=8

Works perfect! :)

Curtis D
06-16-2006, 02:48 PM
I want to set version 2 tags.The link to the PHP manual provided a way. Granted, I'd assumed you'd have looked up the flags. I meant ID3 v2.x tags.


id3_set_tag($file, $tagArray, ID3_V2_1); // Sets ID3 v2.1 tags
id3_set_tag($file, $tagArray, ID3_V2_2); // Sets ID3 v2.2 tags
id3_set_tag($file, $tagArray, ID3_BEST); // Lets ID3 functions determine best version

In either case, glad you got it working ;)

06-16-2006, 02:53 PM
Yeah, I saw that. But I didn't bother to try, because I thought this meant that this function wouldn't work with other than v1.0 and v1.1:

Note: Currently id3_set_tag() only supports version 1.0 and 1.1.

But anyway, now I found a way without needing to install the id3 extension on the server.

Thanks for helping me, though! :)

Curtis D
06-16-2006, 03:03 PM
Ugh, sorry, I breezed over the manual pretty quickly, mainly hunting for syntax. :rolleyes:

I suppose I'll come across my fair share of problems when I decide to combine PHP and mp3. Thanks for clarifying ;)