28 lines
461 B
PHP
28 lines
461 B
PHP
|
<?php
|
||
|
|
||
|
function roundtime($sec) {
|
||
|
if($sec > 3600) {
|
||
|
$hours = floor($sec/3600);
|
||
|
if($hours == 1) {
|
||
|
return $hours . " hour";
|
||
|
}
|
||
|
else {
|
||
|
return $hours . " hours";
|
||
|
}
|
||
|
} else if($sec > 60) {
|
||
|
$mins = floor($sec/60);
|
||
|
if($mins == 1) {
|
||
|
return $mins . " minute";
|
||
|
}
|
||
|
else {
|
||
|
return $mins . " minutes";
|
||
|
}
|
||
|
} else if($sec == 1) {
|
||
|
return $sec . " second";
|
||
|
}
|
||
|
else {
|
||
|
return $sec . " seconds";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|