Skip to content

Instantly share code, notes, and snippets.

@csonuryilmaz
Created December 25, 2018 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csonuryilmaz/90729599be64114df2b7d193a8ec040a to your computer and use it in GitHub Desktop.
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
$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