Ciao a tutti.

Estraggo la data da un campo (datetime) e con substr ricavo anno, mese, giorno, ore e secondi.
Siccome voglio rappresentare il mese in lettere ho creato questa funzione:

Codice PHP:
function mese_lettere_ita($mese){

    
$mesi = array(01=>'Gen',02=>'Feb',03=>'Mar',04=>'Apr',05=>'Mag',06=>'Giu',07=>'Lug',08=>'Ago',09=>'Set',10=>'Ott',11=>'Nov',12=>'Dic'); 

  foreach (
$mesi as $id => $value){
      if(
$mese == $id){
          return 
$value " ";
      } 
    } 

che richiamo con:
Codice PHP:
print mese_lettere_ita(substr($row[data],5,2)) 
.

E fin qui non ci sono problemi, la funzione... funziona.

Se non che... non con tutti i mesi.
Es.
la data 2007-07 -07 12:34:19 restituisce correttamente come mese Lug
la data 2007-06 -07 12:34:19 restituisce correttamente come mese Giu
e così via fino a gennaio.

Andando avanti con i mesi, agosto e settembre non vengono restituiti. Si riparte da ottobre e fino a dicembre senza problemi.

Effetto calura e vacanze estive?

Idee?