[PHP]function from_iso8601_date($isodate, &$y, &$m, &$d)
{
$y = date('Y', strtotime($isodate));
$m = date('m', strtotime($isodate));
$d = date('d', strtotime($isodate));
}
function giorno_succ($data, $as_unixts = false)
{
static $date = array();
if (!array_key_exists($data, $date)) {
$y = $m = $d = 0;
from_iso8601_date($data, $y, $m, $d);
$unixts = mktime(2, 0, 0, $m, ($d + 1), $y, 1);
$date[$data] = array(
'iso' => date('Y-m-d', $unixts),
'unix' => $unixts
);
}
return $as_unixts ? $date[$data]['unix'] : $date[$data]['iso'];
}
$giorno_successivo = giorno_succ('2007-04-23');
[/PHP]
___________________________________
There are 10 kinds of people in this world,
those who can read binary and those who can't.
Care to say "thank you"?
|