How to check that date is today and yesterday in php?
How to check that date is today and yesterday in php?
Use this function for get today and yesterday
if($date == date('d/m/Y')) {
$time_since = 'Today';
} else if($date == date('d/m/Y',now() - (24 * 60 * 60))) {
$time_since = 'Yesterday';
}else
{
$time_since = 'Today';
}
return $time_since;
}
Use this function for get today and yesterday
$date = date('d/m/Y', $time);function get_day_name($
time) {
if($date == date('d/m/Y')) {
$time_since = 'Today';
} else if($date == date('d/m/Y',now() - (24 * 60 * 60))) {
$time_since = 'Yesterday';
}else
{
$time_since = 'Today';
}
return $time_since;
}
Comments
Post a Comment