jeff5656 Posted November 20, 2008 Share Posted November 20, 2008 the following gives me November, which is what I want. $curr_month = date (F); Now how do I get NEXT month? So it displays "December"? I tried this but it doesn't work. I have a bad feeling I need to use mktime but that gives me stomach aches trying to figure it out! <?php echo date (F); $nextmonth = date("F")+1; echo $lastmonth; ?> Quote Link to comment https://forums.phpfreaks.com/topic/133561-next-month/ Share on other sites More sharing options...
DeanWhitehouse Posted November 20, 2008 Share Posted November 20, 2008 <?php echo strtotime("+1 month"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/133561-next-month/#findComment-694708 Share on other sites More sharing options...
jeff5656 Posted November 20, 2008 Author Share Posted November 20, 2008 No if i do <?php echo strtotime("+1 month"); I get this:1229815057 How do i get "December" (or whatever the next month is) Quote Link to comment https://forums.phpfreaks.com/topic/133561-next-month/#findComment-694745 Share on other sites More sharing options...
trq Posted November 20, 2008 Share Posted November 20, 2008 <?php echo date("F", strtotime("+1 month")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/133561-next-month/#findComment-694757 Share on other sites More sharing options...
DeanWhitehouse Posted November 20, 2008 Share Posted November 20, 2008 Oopz sorry should of mentioned that you need to put it in the date(); Quote Link to comment https://forums.phpfreaks.com/topic/133561-next-month/#findComment-694764 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.