Ver Mensaje Individual
  #8 (permalink)  
Antiguo 11/01/2004, 12:22
Avatar de macabro
macabro
 
Fecha de Ingreso: enero-2003
Ubicación: venus >> ((_\
Mensajes: 254
Antigüedad: 23 años, 9 meses
Puntos: 1
Te doy este ejemplo :
supuniendo que tienes en tu base de datos un campo con el nombre fecha
hacemos la seleccion y todo eso
Código PHP:
    
$fecha 
= $row["fecha"];
    
    list(
$anio,$mes,$dia)=explode("-",$row[fecha]);
    
$lista_mes = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", 
                   
"Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); 
        for(
$i = 1; $i <= 12; $i++) { if ($mes==$i){$mes=$lista_mes[$i-1];break;} }
        
$fecha ="$dia-$mes-$anio"; 
//llamamos a la fecha
echo" $fecha"; 
y te saldra 11-Enero-2004

ahora si no quieres los mese con nombres solo sacalo este codigo
Código PHP:
    $lista_mes = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", 
                   
"Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); 
        for(
$i = 1; $i <= 12; $i++) { if ($mes==$i){$mes=$lista_mes[$i-1];break;} } 
Y te saldra 11-01-2004

espero te sirva chauuuuu