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) ;
}
| Top Exits (215)
(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) ;
}





