$month) { for ($i = 1; $i <= $days[$key]; $i++) { if ($month == (floor($i / 10) + floor($i % 10))) { $happyDays++; } } } echo $happyDays . "\n";