PHP date last day of month

PHP date last day of month


Posted in : PHP Posted on : January 28, 2011 at 6:42 PM Comments : [ 0 ]

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 :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics