
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.69 KB | hits: 13 | expires: Never
php strftime French characters
setlocale(LC_ALL, 'fra_fra');
strftime('%d %B %Y', strtotime($post->post_date));
<meta charset="utf-8">
$date_string = utf8_encode(strftime('%d %B %Y', strtotime($post->post_date)));
header('Content-Type: text/html; charset=UTF-8');
<?php
header('Content-Type: text/html; charset=UTF-8');
//header('Content-Type: text/html; charset=ASCII');
$myDate = "Feb 23, 2011";
$locale = 'fr_FR.UTF-8';
setlocale(LC_ALL, $locale);
echo strftime('%d %B %Y', strtotime($myDate));
$locale = 'en_US.UTF-8';
setlocale(LC_ALL, $locale);
echo strftime('%d %B %Y', strtotime($myDate));
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />