Created
December 25, 2018 09:58
-
-
Save csonuryilmaz/90729599be64114df2b7d193a8ec040a to your computer and use it in GitHub Desktop.
Comparing input date with today and decide given input ise history || today || future
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
$data["day"]="25"; | |
$data["month"]="01"; | |
$data["year"]="2017"; | |
$post = strtotime($data['day']."-".$data['month']."-".$data['year']); | |
echo $post; | |
echo "<br/>"; | |
$ctrl = strtotime(date('d-m-Y')); | |
echo $ctrl; | |
echo "<br/>"; | |
if ($post == $ctrl) | |
echo "Today"; | |
else if ($post < $ctrl) | |
echo "History"; | |
else | |
echo "Future"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment