当前位置: 动力学知识库 > 问答 > 编程问答 >

php - store getid3 to database

问题描述:

I have a project that I want the user to input the path (folder only) where the mp3 files are located. The php script 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

分享给朋友:
您可能感兴趣的文章:
随机阅读: