我有来自getID3的php的结果字符串的问题,这个结果是02:00:00,但我想要的结果是00:02:00,怎样才能改变它?请帮助和感谢
$durasi = getDuration($direktori);
$endtime = date('H:i:s', strtotime($durasi));
function getDuration($file){
include_once("getID3/getid3/getid3.php");
$getID3 = new getID3;
$file = $getID3->analyze($file);
return $file['playtime_string'];
}发布于 2016-04-05 13:19:53
playtime_string返回分钟和秒(m:s)。因此,您必须为make strtotime string添加小时数。用gmdate()函数代替date()生成h:i:s格式。
希望这能对你有所帮助
$durasi = getDuration($direktori);
$endtime = gmdate('H:i:s', strtotime('00:'.$durasi)); /// make these changes
function getDuration($file){
include_once("getID3/getid3/getid3.php");
$getID3 = new getID3;
$file = $getID3->analyze($file);
return $file['playtime_string'];
}https://stackoverflow.com/questions/36417150
复制相似问题