-
-
Save globalideias/ff69fe288a3f3cfc21846e358a85ffaa to your computer and use it in GitHub Desktop.
unidades_x_minutos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| const MINUTOS_UNIDADE = 20; | |
| $total_unidades = 23; | |
| $tempo_total = $total_unidades * MINUTOS_UNIDADE; | |
| $horas = (int)($tempo_total / 60); | |
| $minutos = $tempo_total % 60; | |
| if($minutos > 0){ | |
| echo $horas . " Horas e " . $minutos . " Minutos."; | |
| }else{ | |
| echo $horas . " Horas"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment