PHP自定义函数实现格式化秒的方法
本文实例讲述了PHP自定义函数实现格式化秒的方法。分享给大家供大家参考,具体如下: function vtime($time) { $output = ''; foreach (array(86400 => '天', 3600 => '小时', 60 => '分', 1 => '秒') as $key => $value) { if ($time >= $key) $output .= floor($time/$key) . $value; $time %= $key; } if($output==''){ $output=0; } retur
下载地址
用户评论