In this tutorial you will learn how to find PHP date last day of month in a PHP web application .
PHP date last day of month
In this tutorial you will learn how to find PHP date last day of month in a PHP web application . In this tutorial use mktime() function that convert date to timestamp and again find date first and last day of month . The code of "php-date-last-day-of-month.php" given below :
<?php $firstDay = date("jS F, Y", mktime(0, 0, 0, date("m") , 1, date("Y"))); echo "First day of month : ".$firstDay."<br>"; echo "Last day of month : "; $lastDay = date("jS F, Y", mktime(0, 0, 0, date("m")+1 , 0, date("Y"))); echo $lastDay."<br>"; ?>
Output :
When run "php-date-last-day-of-month.php" display output as :
[ 0 ] Comments