codice:
function sommaGiorni($data,$nGiorniDaSommare){      
      list($anno,$mese,$giorno) = explode('-',$data);
      return date("d-m-Y",mktime(0,0,0,$mese,$giorno+$nGiorniDaSommare,$anno));
}
genera i seguenti errori

Notice: Undefined offset: 2 in XXX on line 3

Notice: Undefined offset: 1 in XXX on line 3

Warning: mktime() expects parameter 6 to be long, string given in XXX on line 4

Dove sbaglio?