Edit mp3metatag using getid3 in php

Started on the old forum in November 2020 · view the original in the archive · old links redirect here

No replies · 31 views · started 6 years ago · 1 min read

ayesham Developer · 69 posts #1

Is there anyone who knows how to edit mp3meta tag in php

include("db.php");
$id=$_REQUEST['id'];
$query = "SELECT * from files where id='".$id."'";
function scanID3($file)
{
require_once 'getid3/getid3.php'; 
$res = false;
$getID3 = new getID3();
$id3 = $getID3->analyze($file);
if (isset($id3["fileformat"]) && $id3["fileformat"] == "mp3") {
$res = array();
$res["file"] = $file;
if (isset($id3["tags"]["id3v2"]["artist"][0])) {
$res["artist"] = $id3["tags"]["id3v2"]["artist"][0];
} else {
$res["artist"] = "Unknown";
}

if(isset($id3['comments']['picture'][0])){
$res['image'] = 'data:'.$id3['comments']['picture'][0]['image_mime'].';charset=utf-8;base64,'.base64_encode($id3['comments']['picture'][0]['data']);
}
else
{
$res['image'] = 'unknown';
}
} else {
//var_dump($file);
}

return $res;
}
?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close