1、下载getid3类文件包
获取getid3和helperapps文件包
2、引用文件getid3包中getid3.php文件
include_once('getid3.php');
$path = '../../***/**/xxxx.mp3';//不可用网络资源路径
$getID3 = new getID3(); //实例化类
$ThisFileInfo = $getID3->analyze($path); //分析文件,$path为音频文件的地址
$fileduration=$ThisFileInfo['playtime_seconds']; //这个获得的便是音频文件的时长
$time = (int)ceil($fileduration);