Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Comparing input date with today and decide given input ise history || today || future
$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";
echo "Future";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment