Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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