date in an other language????

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

kumschick
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Nov 25, 2003 4:40 pm
Location: Luxembourg
Contact:

date in an other language????

Postby kumschick » Tue Nov 25, 2003 4:48 pm

How can I get this translated into an other language?

$today = date("F j, Y");
//November 26, 2004

in french:
$today = date("F j, Y");
//Novembre 26, 2004

User avatar
yK
New php-forum User
New php-forum User
Posts: 28
Joined: Tue Aug 19, 2003 1:27 pm
Contact:

Postby yK » Tue Nov 25, 2003 5:17 pm

this should work :

Code: Select all

<?

$month = Date(F);

function gofrench($month){

$frenchmonth = array(
   January => "Janvier",
   February => "Février",
   March => "Mars",
   April => "Avril",
   May => "Mai",
   June => "Juin",
   July => "Juillet",
   August => "Août",
   September => "Septembre",
   October => "Octobre",
   November => "Novembre",
   December => "Décembre"
);

$i = Date("j, Y");

$x = $frenchmonth[$month];

$f = $x." ".$i;

return $f;

}

print(gofrench($month));

?>


i havent tested it though


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests