我想要在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'];
?>发布于 2014-02-17 09:53:27
你在这行的末尾漏掉了一个分号
$ThisFileInfo = $getID3->analyze($pathName);
//^------ Add one here https://stackoverflow.com/questions/21825719
复制相似问题