Ciao a tutti
sto cercando di convertire un campo DATE (AAAA-MM-GG) in una data "umana" (Giorno GG Mese AAAA)

Ho provato con questa funzione ma qualcosa non funziona.

Codice PHP:
function return_day_of_week($date)
    {
        
$sy=substr($date04);
        
$sm=substr($date52);
        
$sd=substr($date82);
        
$date_utc=mktime(0,0,0,$sm$sd$sy);
        
$today_utc=mktime(0,0,0,date("m"), date("d"), date("Y"));
        if(
$date_utc>$today_utc){
            
$future_date=1;
            
$temp=$date_utc;
            
$date_utc=$today_utc;
            
$today_utc=$temp;
        }
        
$utc_difference=$today_utc-$date_utc;
        
$weeks_count=($utc_difference)/604800;
        if(
$weeks_count<10)
            
$weeks_count=substr($weeks_count01);
        else if(
$weeks_count<100)
            
$weeks_count=substr($weeks_count02);
        else if(
$weeks_count<1000)
            
$weeks_count=substr($weeks_count03);
        
$days_rest_count=substr(($utc_difference-$weeks_count*604800)/8640001);
        
$was_day_of_week=date("w")-$days_rest_count;
        if(
$was_day_of_week 0){
            if(
$future_date==1)
                
$was_day_of_week=0-$was_day_of_week;
            else
                
$was_day_of_week+=7;
        }
        return 
$was_day_of_week;
    } 
Dove sbaglio? :S