$time=9;
if($time>60){
$min=($time/60);
if(is_float($min)){
$min=floor($min);
$min=($min*60);
$sec=($time-$min);
$min=($min/60);
echo " $min:$sec Min";
}
else {
echo "$time Min";
}
}
else {
echo "$time Sec";
}
?>
Function mode
<?php
function minutes($time) {
if($time>60){
$min=($time/60);
if(is_float($min)){
$min=floor($min);
$min=($min*60);
$sec=($time-$min);
$min=($min/60);
return " $min:$sec Min";
}
else {
return "$time Min";
}
}
else {
return "$time Sec";
}
}
?>
echo minute(784);
No hay comentarios:
Publicar un comentario