How to check current day is the last day of the month in php andrey пятница, 23 мая 2014 г. No Comment

We can simply use PHP's 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!

We can simply use PHP's 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!

by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment