PHP Get metadata of remote .mp3 file (from URL

2019-05-11 08:12发布

I am trying to get song name / artist name / song length / bitrate etc from a remote .mp3 file
such as http://shiro-desu.com/scr/11.mp3 .

I have tried getID3 script but from what i understand it doesn't work for remote files as i got this error: "Remote files are not supported - please copy the file locally first"

Also, this code:

<?php
$tag = id3_get_tag( "http://shiro-desu.com/scr/11.mp3" );
print_r($tag);
?>

did not work either.
"Fatal error: Call to undefined function id3_get_tag() in /home4/shiro/public_html/scr/index.php on line 2"

标签: php mp3 metadata
1条回答
萌系小妹纸
2楼-- · 2019-05-11 08:54

As you haven't mentioned your error I am considering a common error case undefined function

The error you get (undefined function) means the ID3 extension is not enabled in your PHP configuration:

If you dont have Id3 extension file .Just check here for installation info.

查看更多
登录 后发表回答