N
N
Name Imechko2015-10-31 15:02:16
PHP
Name Imechko, 2015-10-31 15:02:16

Crocosebras setlocale(LC_ALL, "russian")?

<?php
setlocale(LC_ALL, "russian");
  $day = strftime('%d');
  $mon = strftime('%B');
  $year = strftime('%Y');

echo "Сегодня $day число, $mon месяц и $year год.";
?>

Сегодня 31 число, ������� месяц и 2015 год.
What is the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Name Imechko, 2015-11-01
@Elem3nt071

I solved the problem with this design...

setlocale(LC_ALL, 'russian');
$mon = strftime('%B');
$mon = iconv('windows-1251', 'utf-8', $mon);

A
Alexander Latyshev, 2015-10-31
@magalex

setlocale(LC_ALL, "ru_RU.UTF-8");

N
Nikita, 2015-10-31
@Panda_Tamara

setlocale('LC_TIME' , 'ru_RU.utf8')

A
AlikDex, 2015-10-31
@AlikDex

1) installed php encoding.
2) the installed Apache encoding, or whatever you have on the return.
3) script file encoding.
4) browser encoding.
5) lack of locale.
the first 4 points must match. Then you will never have problems with "krakozyabry".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question