开发者

store getid3 to database

开发者 https://www.devze.com 2023-02-03 16:49 出处:网络
I have a project that I want the user to input the path (folder only) where the mp3 files are located. The php s开发者_如何学Gocript will input all the filename and the getid3 information into databas

I have a project that I want the user to input the path (folder only) where the mp3 files are located. The php s开发者_如何学Gocript will input all the filename and the getid3 information into database. How do you do that? is it possible?

I found this http://php.net/manual/en/function.readdir.php, but I dont' know how to link it with getid3 together to get the result that I describe above

Can someone show me a sample of how this work and store it in sql database? Thanks


While this is a very broad question I'll try to provide some hints.

//basic use of getid3 returns a massive deep array of values that really sucks to parse
$id3 = new getid3();
$result = $id3->analyze(filename);

//example of access of retruned data
$albumName = $result['id3v2']['comments']['album'][0];
$artist = $result['id3v2']['comments']['artist'][0];

you put this in a database the same way you would any other data

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号