Last active
April 23, 2020 16:27
-
-
Save rmsaitam/83519dee3cf2012318758e04261ad088 to your computer and use it in GitHub Desktop.
Comparação de hora em PHP
This file contains 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 | |
$hora_fixa = strtotime("13:18"); | |
$hora = strtotime(date('G:i')); //G 0-23 horas, i minutos | |
echo $hora .'<br>'; | |
if($hora == $hora_fixa) { | |
echo "ok"; | |
} | |
else { | |
echo "passou da hora"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment