corillo181 Posted July 3, 2007 Share Posted July 3, 2007 alright so the idea is to take the current month and add 9 more months to it.. but when it gets to 12 since 13 is not a month i need the loop to break out and continue the rest of the number as 1 2 3 4 and so on.. this is wha ti have so far. <?php for($i=date("m");$i<date("m")+9;$i++){ $year=($i>12)?date("Y")+1:date("Y"); calendar($i,$year,NULL); } ?> Quote Link to comment Share on other sites More sharing options...
wcsoft Posted July 3, 2007 Share Posted July 3, 2007 Something like this would work: $month = $date("m"); $year = $date("Y"); for($i=1;$i<=9;$i++) { calendar($month,$year,NULL); $month++; if ($month > 12) { $month = 1; $year++; } // end if } // end for Quote Link to comment Share on other sites More sharing options...
corillo181 Posted July 3, 2007 Author Share Posted July 3, 2007 nice!! Quote Link to comment Share on other sites More sharing options...
wcsoft Posted July 3, 2007 Share Posted July 3, 2007 As typical, I really need to pay attention to the code I post. The $date portions, should just be date: $month = date("m"); $year = date("Y"); for($i=1;$i<=9;$i++) { calendar($month,$year,NULL); $month++; if ($month > 12) { $month = 1; $year++; } // end if } // end for 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.