lilywong Posted March 15, 2006 Share Posted March 15, 2006 I want to dispaly this month, and next month together as below:[b]March / April 2006 [/b]i use :<?$today = date("F");?><? echo $today; ?> / April 2006 How do i calculate so that i can also display the next month automatically ? thanks Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 15, 2006 Share Posted March 15, 2006 [code]$thismonth = date("F");$nextmonth = date("F", mktime(NULL, NULL, NULL, date("m") + 1, date("d"), date("Y")));echo $thismonth . " / " . $nextmonth;[/code] Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 15, 2006 Share Posted March 15, 2006 Here's another method:[code]<?php echo date('F') . '/' . date('F',strtotime('next month')) . ' ' . date('Y'); ?>[/code]Ken Quote Link to comment 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.