note 101470 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Thu, 09 Feb 2012 20:51:56 +0000 |
| Subject: | note 101470 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185963@lists.php.net to get a copy of this message | ||
Note Submitter: khaine at herbok dot org
----
A function to show $a days later.
<?php
function dateafter ( $a )
{
$hours = $a * 24;
$added = ($hours * 3600)+time();
$days = date("l", $added);
$month = date("F", $added);
$day = date("j", $added);
$year = date("Y", $added);
$result = "$day $month $year - $days";
return ($result);
}
echo dateafter("10");
//this will shows the data of ten days after.
// if today is 19 December 2010, Sunday, the page prints : 29 December 2010 - Wednesday.
?>