I set the function below that returns me hours in this format 4:5:3
(hour, minute, second).
I would like to return in this format 04:05:03
(hour, minute, second).
function converter($time)
{
if (is_int($time)) {
$horas = floor($time / 3600);
$minutos = floor(($time - ($horas * 3600)) / 60);
$segundos = floor($time % 60);
$newtime = $horas . ":" . $minutos . ":" . $segundos;
} else {
echo "o valor deve ser um inteiro";
}
return $newtime;
}