Canman2005 Posted November 25, 2009 Share Posted November 25, 2009 Hi all I wonder if you can help. I have this code $startdate = "10 october 2009"; function printMonths($var) { $start = strtotime($var); $now = strtotime("Now"); while ($start < $now) { echo date("F Y", $start); echo "<br>"; $start = strtotime("+1 month", $start); } } printMonths($startdate); which works fine and gives me October 2009 November 2009 but is it possible, to list the next 12 months and inbetween each month also list each day of that month? thanks everyone dave Link to comment https://forums.phpfreaks.com/topic/182921-list-next-7-days-and-months/ Share on other sites More sharing options...
cags Posted November 25, 2009 Share Posted November 25, 2009 You should be able to loop through the days using a combination of date and mktime. Just put another loop inside your current loop Link to comment https://forums.phpfreaks.com/topic/182921-list-next-7-days-and-months/#findComment-965476 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.