I'm making a calendar and I've run into a problem concerning February.
I've made a script that can get me the first and last date of a month X months into the past/future, but for some reason it skips right past February.
$month = 1;
$time = strtotime($month." month");
$first_last = date('Ym01', $time)." AND ".date('Ymt', $time);
echo $first_last;
If I set $month to 1 I should get 1 month into the future, but for some reason it shows March both av value 1 and 2, when it should show February if the value is 1 and March if the value is 2. This of course depending of the current month.
This also happens if a go a whole year forward in time.
Anyone got some bright ideas?