mrplatts Posted November 19, 2006 Share Posted November 19, 2006 I'm using a simple calendar display with using [code]<?php for($m=8; $m<=12; $m++) { $date_month = $m;$date_year = 2006;$theday = date(w, mktime(0, 0, 0, $date_month, 1, $date_year));$daysinmonth = date("t", mktime(0, 0, 0, $date_month, 1, $date_year));echo "<table align=center border=0>";echo "<tr>><td colspan=7 align=center>".date("F", mktime(0, 0, 0, $date_month, 1, $date_year))." (".date("Y", mktime(0, 0, 0, $date_month, 1, $date_year)).")</td></tr>";echo "<tr>";echo "<td>Sun</td>";echo "<td>Mon</td>";echo "<td>Tue</td>";echo "<td>Wed</td>";echo "<td>Thu</td>";echo "<td>Fri</td>";echo "<td>Sat</td>";echo "</tr>";echo "<tr>";for ($i=0;$i<$theday;$i++){ echo "<td> </td>";}for ($list_day=1;$list_day<=$daysinmonth;$list_day++){?>[/code]... well you get the idea.I want to start showing the date at a specified start month and end display with a specified end month, in the next year. Is there a way to loop this efficiently? I know I could do it with a convoluted set of loops. More specifially, for example it would display from august 2006 -- June 2007. Link to comment https://forums.phpfreaks.com/topic/27792-resolved-efficient-looping-structure/ Share on other sites More sharing options...
mrplatts Posted November 19, 2006 Author Share Posted November 19, 2006 I figured it out. Rich Link to comment https://forums.phpfreaks.com/topic/27792-resolved-efficient-looping-structure/#findComment-127173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.