codice:
function operation($operator,$date,$operand)
{
$ts = mktime("", "", "", substr($date,3,2), substr($date,0,2), substr($date,6,4));
$t=explode('%',$operand);
$how=$t[0];
switch($t[1])
{
case 'D':
{
if($operator=='+' || $operator=='sum' || $operator=='add')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts),date('d',$ts)+$how,date('Y',$ts)));
}
elseif($operator=='-' || $operator=='sub' || $operator=='sot')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts),date('d',$ts)-$how,date('Y',$ts)));
}
break;
}
case 'M':
{
if($operator=='+' || $operator=='sum' || $operator=='add')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts)+$how,date('d',$ts),date('Y',$ts)));
}
elseif($operator=='-' || $operator=='sub' || $operator=='sot')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts)-$how,date('d',$ts),date('Y',$ts)));
}
}
case 'Y':
{
if($operator=='+' || $operator=='sum' || $operator=='add')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts),date('d',$ts),date('Y',$ts)+$how));
}
elseif($operator=='-' || $operator=='sub' || $operator=='sot')
{
return date("d/m/Y",mktime(0,0,0,date('m',$ts),date('d',$ts),date('Y',$ts)-$how));
}
break;
}
}
}
alla riga segnalata, cioè la 583 c'è scritto questo:
codice:
$ts = mktime("", "", "", substr($date,3,2), substr($date,0,2), substr($date,6,4));
Potete aiutarmi per cortesia ?