Last active
July 1, 2017 16:40
-
-
Save u-mulder/ef067b44c83da584166ea94304e6124a to your computer and use it in GitHub Desktop.
Число дней в произвольном месяце произвольного года
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$year = 2016; | |
foreach (range(1,12) as $month) { | |
var_dump(getDaysCount($month, $year)); | |
} | |
function getDaysCount($month, $year) | |
{ | |
return date('t', strtotime('01.' . $month . '.' . $year)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment