|
|
Ok!
|
|
|
Ok!
|
|---|---|---|---|---|
| 182 | <?
$today = new DateTime();
$begin = new DateTime('January 01');
$ny1 = new DateTime('December 20');
$ny2 = new DateTime('January 8');
$spring = new DateTime('March 01');
$summer = new DateTime('June 01');
$fall = new DateTime('September 01');
$winter = new DateTime('December 01');
switch (true) {
case $today >= $ny1 || $today < $ny2:
echo 'Новогоднее настроение';
break;
case ($today >= $winter || $today >= $begin) && $today < $spring:
echo 'Зимнее настроение';
break;
case $today >= $spring && $today < $summer:
echo 'Весеннее настроение';
break;
case $today >= $summer && $today < $fall:
echo 'Летнее настроение';
break;
case $today >= $fall && $today < $winter:
echo 'Осеннее настроение';
break;
default:
break;
}
?> | зимнее, весеннее | 100 | зимнее или весеннее |