Created
May 29, 2020 20:52
-
-
Save IsaacAndres/afa3586e86bac7b3149f3a40eea9d1eb to your computer and use it in GitHub Desktop.
Comparar si fecha esta dentro del rango
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 | |
function check_in_range($fecha_inicio, $fecha_fin, $fecha){ | |
$fecha_inicio = strtotime($fecha_inicio); | |
$fecha_fin = strtotime($fecha_fin); | |
$fecha = strtotime($fecha); | |
if(($fecha >= $fecha_inicio) && ($fecha <= $fecha_fin)) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment