PHP程序小实例(连载)-- 计算总时间
希望这个功能有用^_^。 

$et = elapsedtime(date("U") - $stdate) 

它会显示成这样: 
[1h,41m]  

(1 小时, 41 分) 

<? 
function elapsedtime($sec){ 
 
$days  floor($sec 86400); 
 
$hrs   floor(bcmod($sec,86400)/3600); 
 
$mins  round(bcmod(bcmod($sec,86400),3600)/60); 
 if(
$days 0$tstring $days "d,"
 if(
$hrs  0$tstring $tstring $hrs "h,"
 
$tstring "[" $tstring $mins "m]"
 return 
$tstring


?>