我想在PHP中获取MP3文件的长度。我通过谷歌找到的代码来自getID3,但它不起作用。
我总是收到以下错误消息,我不知道如何解决它。
PHP Parse error: syntax error, unexpected T_ECHO in /.../getDuration.php on line 17
我的PHP代码:
<?php
$include = dirname(__FILE__). '/';
include_once $include . 'getid3.php';
include_once $include . 'getid3.lib.php';
include_once $include . 'module.audio.mp3.php';
include_once $include . 'module.tag.apetag.php';
include_once $include . 'module.tag.id3v1.php';
include_once $include . 'module.tag.id3v2.php';
$pathName = '/var/..../audio/audio.mp3';
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($pathName)
echo $ThisFileInfo['playtime_string'];
?>
您错过了此行末尾的分号
$ThisFileInfo = $getID3->analyze($pathName);
//^------ Add one here