Monthly Archives: August 2011

Get number of days in month with PHP

Problem: get number of days in certain month with PHP, if $m – is a month and $y – is an year. First solution, hacker-style (source): (31 - (($m - 1) % 7 % 2) - ((($m == 2) << !!($y % 4)))) ?> This solution doesn’t work properly for years divisible by 100, and non-divisible by … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment