nettoon1991 Posted March 23, 2009 Share Posted March 23, 2009 I dont know if this is possible but i have a simple calender script that uses increments i want to do something like this if ($day++ == 6) {_replace(6, 6 detail,$day++)} sorry im so bad at php this is the entire script i didnt make but learned from a tutorial <?php $date = time (); $day = date('d', $date); $month =date('m', $date); $year = date('Y', $date); $title = date('F', $first_day); $day_of_week = date('D', $first_day); switch($day_of_week){ case "Sun": $blank = 0; break; case "Mon": $blank = 1; break; case "Tue": $blank = 2; break; case "Wed": $blank = 3; break; case "Thu": $blank = 4; break; case "Fri": $blank = 5; break; case "Sat": $blank = 6; break; } $days_in_month = cal_days_in_month(0, $month, $year); echo "<table border=6 width=394>"; echo "<tr><th colspan=60> $title2 $year </th></tr>"; echo "<tr><td width=62>S</td><td width=62>M</td><td width=62>T</td><td width=62>W</td><td width=62>Th</td><td width=62>F</td><td width=62>S</td>"; echo "$lol"; $day_count =1; echo "<tr>"; while ( $blank > 0 ) { echo "<td></td>"; $blank = $blank-1; $day_count++; } $day_num = 1; $day_num = ereg_replace('6', dood, $day_num++); while ( $day_num <= $days_in_month ) { echo "<td> $day_num </td>"; $day_num++; $day_count++; if ($day_count > 7) { echo "</td><tr>"; $day_count = 1; } } while ( $day_count >1 && $day_count <-7 ) { echo "<td> </td>"; $day_count++; } echo "</tr></table>"; ?> Quote Link to comment Share on other sites More sharing options...
Renlok Posted March 23, 2009 Share Posted March 23, 2009 well it would have to be if ($day++ == 6) { str_replace(6, '6 detail',$day++)} 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.