php获取音乐文件播放总时间
/*
* @Author : 冷流云
*
**/
<?php
// mp3, wav 或者其他 media player 支持的格式.
$file = realpath("1.mp3");
$player= new COM("WMPlayer.OCX");
$media = $player->newMedia($file);
$time=$media->duration; // “单位/秒”
$h=floor($time/3600);
$m=floor(($time %3600)/60);
$s=floor($time-$h*3600-$m*60);
echo $h."小时".$m."分".$s."秒";
?>
以上就是PHP获取音乐文件播放总时间的内容,更多相关内容请关注PHP中文网(www.php.cn)!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号