Jun 4
Come passare dal formato anno-mese-giorno al formato giorno-mese-anno ??? 4 righe !!!
(la funzione prevede anche la presenza dell'ora, classico datatime di mySql)


function invertDate($string)
{
      $tmp = explode(' ', $string) ;
      $tmp2 = explode('-', $tmp[0]) ;
      $tmp2 = array_reverse($tmp2) ;
      $tmp[0] = implode('-', $tmp2);
      return implode(' ', $tmp) ;
}
 

Posted by Emanuele Turella

| Top Exits (215)
Vote for articles fresher than 30 days!
Current karma: 1 of 5, 1 vote(s) 422 hits