Yngvarr

Generation

generate functionTue, 14 Feb 2023

en месяцы

function enMonth($day, $month, $year) { $day = ($year % 4 == 0) ? $day: $day+1; $days = [31, $day, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; $enMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; $d = 0; for ($i = 0; $i < count($days); $i++) { if ($month > $days[$i]) { $d += $days[$i]; } else { $d += $month; break; } } //echo $d . "<br>"; $m = 0; for ($i = 0; $m < $d; $i++) { $m += $days[$i]; }

Questions about programming?Chat with your personal AI assistant