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 Link to comment https://forums.phpfreaks.com/topic/4998-date-problem/ 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] Link to comment https://forums.phpfreaks.com/topic/4998-date-problem/#findComment-17676 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 Link to comment https://forums.phpfreaks.com/topic/4998-date-problem/#findComment-17680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.