note 103641 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Mon, 05 Sep 2011 13:02:09 +0000 |
| Subject: | note 103641 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182950@lists.php.net to get a copy of this message | ||
Note Submitter: falkon303 at gmail dot com
----
I thought this function was super simple to understand, and very useful. I hope some of you find it
useful.
<?php
/// These are the variables you'd set to your needs
$month = "4";
$day = "25";
$year = "2011";
function date_finder($increment, $month, $day, $year)
{
return date("F-d-Y", strtotime($increment, mktime(0, 0, 0, $month, $day, $year)));
}
$last_month = date_finder("-1 month", $month, $day, $year);
echo $last_month;
?>