1 2 3 4 5 6 7 8 9 10
<?php function fecha () { $vect=getdate(); $vect_dia=array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"); $vect_mes=array("Diciembre","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre"); return $vect_dia[$vect[wday]].", ".$vect[mday]." de ".$vect_mes[$vect[mon]]." de ".$vect[year]; } echo fecha()."<br>"; ?>
Refactorings
No refactoring yet !
Mlopez
December 22, 2007, December 22, 2007 02:56, permalink
you can remove the "hoy es".
i'm a little rusty on my spanish but it works.
http://www.mspy2.com/spanish.php - a working test.
we will find out on january 1st if it completely works.
1 2 3 4 5 6 7 8 9 10
<?php function fecha () { $vect=getdate(); $vect_dia=array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"); $vect_mes=array("empty","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); return $vect_dia[$vect[wday]].", ".$vect[mday]." de ".$vect_mes[$vect[mon]]." de ".$vect[year]; } echo "Hoy es ".fecha()."<br>"; ?>
hi, I'm a student and i create this function, he print an spanish format date.