Wednesday, 8 October 2014

Last Day of the Month With PHP



Get last day of the current month
<?php
$lastday = date('t',strtotime('today'));

echo $lastday;

?>

Get last day of next month
<?php
$lastday = date('t',strtotime('next month'));

echo $lastday;

?>

Get last day of any other month
Enter any month/day/year to get the last day of that month
<?php
$lastday = date('t',strtotime('8/10/2014'));

echo $lastday;


?>

0 comments:

Post a Comment