aebstract Posted January 7, 2009 Share Posted January 7, 2009 Okay, I was working with someone and had solved the topic lalal and would rather not bring it back up. I realized it won't really do anything by year and it won't add/remove a month from other months other than the current one found by date();. I need to be able to manually put in a month and year and be able to find the next month and previous month. $previous = date("F Y",strtotime('-1 month')); $next = date("F Y",strtotime('+1 month')); Quote Link to comment https://forums.phpfreaks.com/topic/139839-solved-nextprevious-months/ Share on other sites More sharing options...
RussellReal Posted January 7, 2009 Share Posted January 7, 2009 ok easy.. lets assume.. $_GET['date'] equals 02/31/1994 $previous = date("d/m/Y",strtotime("{$_GET['date']} -1 month")); $next = date("d/m/Y",strtotime("{$_GET['date']} +1 month")); Quote Link to comment https://forums.phpfreaks.com/topic/139839-solved-nextprevious-months/#findComment-731555 Share on other sites More sharing options...
aebstract Posted January 7, 2009 Author Share Posted January 7, 2009 Could we possibly go in a route more of I have $month = February and $year = 2008. Build off of that? Quote Link to comment https://forums.phpfreaks.com/topic/139839-solved-nextprevious-months/#findComment-731565 Share on other sites More sharing options...
RussellReal Posted January 7, 2009 Share Posted January 7, 2009 $_GET['date'] equals 02/31/1994 $previous = date("d/m/Y",strtotime("$month 1st, $year -1 month")); $next = date("d/m/Y",strtotime("$month 1st, $year +1 month")); Quote Link to comment https://forums.phpfreaks.com/topic/139839-solved-nextprevious-months/#findComment-731580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.