<?php
function calctime($aantal_seconden){
if(!is_numeric($aantal_seconden)){
return;
}
$sec = $aantal_seconden;
$minuten = 0;
$uren = 0;
while($sec>=3600){
$uren++;
$sec-=3600;
}
while($sec>=60){
$minuten++;
$sec-=60;
}
if(strlen($sec)==1){
$sec= '0'.$sec;
}
if($uren>0and(strlen($minuten)==1)){
$minuten = '0'.$minuten;
}
if($uren>0){
$tijd = $uren.':'.$minuten.':'.$sec.' uur';
}
elseif($uren==0and($minuten>0)){
$tijd = $minuten.':'.$sec.' minuten';
}
return $tijd;
}
?>