PHP: How to check if a date is today, yesterday or tomorrow
I would like to check, if a date is today, tomorrow, yesterday or else. But my code doesn’t work. Code: $timestamp = “2014.09.02T13:34”; $date = date(“d.m.Y H:i”); $match_date = date(‘d.m.Y H:i’, strtotime($timestamp)); if($date == $match_date) { //Today } elseif(strtotime(“-1 day”, $date) == $match_date) { //Yesterday } elseif(strtotime(“+1 day”, $date) == $match_date) { //Tomorrow } else … Read more