vic4884
1/25/2019 - 3:48 AM

Знак зодиака php

<?php
function zodiac($day, $month){
  $signs = [
    1=>  "Козерог",
    2=>  "Водолей",
    3=>  "Рыбы",
    4=>  "Овен",
    5=>  "Телец",
    6=>  "Близнецы",
    7=>  "Рак",
    8=>  "Лев",
    9=>  "Девы",
    10=> "Весы",
    11=> "Скорпион",
    12=> "Стрелец"
  ];
  $signsstart =[
    1=>   22,
    2=>   20,
    3=>   19,
    4=>   21,
    5=>   20,
    6=>   21,
    7=>   21,
    8=>   23,
    9=>   23,
    10=>  23,
    11=>  23,
    12=>  22
  ];
    if ($day < $signsstart[$month + 1]) {
      return $signs[$month - 1 ];
    }
    else {
      return $signs[$month % 12 + 1];
    }
}
  print_r(zodiac(30,6));