My spanish month script issue
Posted: Thu Jul 15, 2010 9:44 am
Greetings php technorati. Another small issue has reared its face. What I want to do is to translate the month from english to spanish when the date is echoed on the page. But what I am getting is the English and the Spanish month being printed at the same time. Here is the code:
Here is the output of the code:
"JulioJuly 15, 2010"
Can someone show me the right way?
Thanks in advance
Batoe
Code: Select all
<?
$F = date("F");
if (date("F") == January)
{
echo "Enero";
}
if (date("F") == February)
{
echo "Febrero";
}
if (date("F") == March)
{
echo "Marzo";
}
if (date("F") == April)
{
echo "Abril";
}
if (date("F") == May)
{
echo "Mayo";
}
if (date("F") == June)
{
echo "Junio";
}
if (date("F") == July)
{
echo "Julio";
}
if (date("F") == August)
{
echo "Agosto";
}
if (date("F") == September)
{
echo "Septiembre";
}
if (date("F") == October)
{
echo "Octubre";
}
if (date("F") == November)
{
echo "Noviembre";
}
if (date("F") == December)
{
echo "Diciembre";
}
print $F ?> <?php print (Date("d, Y")); ?>"JulioJuly 15, 2010"
Can someone show me the right way?
Thanks in advance
Batoe