Forum
Notifications
Clear all
Topic starter
Here's a function to translate date from English To French:
<?php
function dte_fmt_frc($dte){
$txt_eng = array(
"Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday", "January",
"February", "March", "April", "May",
"June", "July", "August", "September",
"October", "November", "December"
);
$txt_frc = array(
"Lundi", "Mardi", "Mercredi", "Jeudi",
"Vendredi", "Samedi", "Dimanche", "Janvier",
"Février", "Mars", "Avril", "Mai",
"Juin", "Juillet", "Août", "Septembre",
"Octobre", "Novembre", "Décembre"
);
$dte_fmt_frc = str_replace($txt_eng, $txt_frc, $dte);
$txt_eng = array(
"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"
);
$txt_frc = array(
"Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim",
"Jan", "Fév", "Mar", "Avr", "Mai", "Jui",
"Jui", "Aoû", "Sep", "Oct", "Nov", "Déc"
);
$dte_fmt_frc = str_replace($txt_eng, $txt_frc, $dte_fmt_frc);
return $dte_fmt_frc;
}
?>
Here's a sample of usage:
<?php
$dte = date('M d, Y');
echo dte_fmt_frc($dte);
?>
Posted : 22/05/2012 3:58 pm
thanks alot fro the information and for the code
Posted : 08/06/2012 8:38 pm