Jump to content
  • 0

вывод даты на русском


woofs
 Share

Question

Как вывести дату на русском формата: 21 май 2009 - четверг ? на PHP

Как вывести дату на русском формата: 21 май 2009 - четверг ? на PHP

<?php
$month[1] = "Январ";
$month[2] = "Феврал";
$month[3] = "Март";
$month[4] = "Апрел";
$month[5] = "Ма";
$month[6] = "Июн";
$month[7] = "Июл";
$month[8] = "Август";
$month[9] = "Сентябр";
$month[10] = "Октябр";
$month[11] = "Декабр";
$month[12] = "Январ";
$day[0] = "Воскресенье";
$day[1] = "Понедельник";
$day[2] = "Вторник";
$day[3] = "Среда";
$day[4] = "Четверг";
$day[5] = "Пятница";
$day[6] = "Суббота";
$dnum = date("w");
$mnum = date("n");
$daym = date("d");
$year = date("Y");
$textday = $day[$dnum];
$monthm = $month[$mnum];
if ($mnum==3||$mnum==8)
{
$k="а";
}
else
{
$k="я";
}
echo "Сегодня: $textday, $daym $monthm$k $year г.";
?>

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Это он вроде того поделился гениальным решением ;)

if ($mnum==3||$mnum==8)

{

$k="а";

}

else

{

$k="я";

}

А не легче было сразу у месяцев окончания дописать?

И нафига столько лишних скобок?

$monthm$k
И что содержится в этой адской переменной? Edited by Int
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy