We can simply use PHP's
So, we can simply implement our
data()
function to do this.-
date('t')
will return the last day of the month. -
date('j')
will return the current day of the month.
So, we can simply implement our
if-else
logic here to get the output.$maxDays = date('t');
$currentDay = date('j');
if($maxDays == $currentDay)
{
echo 'Last Day of month';
}
else
{
echo 'Not last day of the month';
}
Have any doubt, feel free to comment here!
0 comments:
Post a Comment