PHP date one month ago

PHP date one month ago


Posted in : PHP Posted on : February 1, 2011 at 6:07 PM Comments : [ 0 ]

In this tutorial you will learn how to find PHP date one month ago in a PHP web application .

PHP date one month ago

In this tutorial you will learn how to find  PHP date one month ago in a PHP web application . The code of "php-date-one-month-ago.php"  given below :

<?php
$date='2011-01-28';
echo "Date :: ".$date."<br>";
$date_arr=explode('-',$date);
echo "Date one month ago =>";
echo Date("Y-m-d",mktime(0,0,0,$date_arr[1]+1,$date_arr[2],$date_arr[0]))."<br>";
?>

Output :

When run "php-date-one-month-ago.php" display output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


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

 
Tutorial Topics