Støv, fibre og metalliske partikler kan påvirke både uptime, levetid og driftssikkerhed. Derfor arbejder flere datacentre systematisk med contamination control.
// Get the first day of the month $month_start = mktime(0,0,0,$month, 1, $year);
// Get friendly month name $month_name = date('M', $month_start);
// Figure out which day of the week // the month starts on. $month_start_day = date('D', $month_start);
switch($month_start_day){ case "Sun": $offset = 0; break; case "Mon": $offset = 1; break; case "Tue": $offset = 2; break; case "Wed": $offset = 3; break; case "Thu": $offset = 4; break; case "Fri": $offset = 5; break; case "Sat": $offset = 6; break; }
// determine how many days are in the last month. if($month == 1){ $num_days_last = cal_days_in_month(0, 12, ($year -1)); } else { $num_days_last = cal_days_in_month(0, ($month -1), $year); } // determine how many days are in the current month. $num_days_current = cal_days_in_month(0, $month, $year);
// Build an array for the current days // in the month for($i = 1; $i <= $num_days_current; $i++){ $num_days_array[] = $i; }
// Build an array for the number of days // in last month for($i = 1; $i <= $num_days_last; $i++){ $num_days_last_array[] = $i; }
// If the $offset from the starting day of the // week happens to be Sunday, $offset would be 0, // so don't need an offset correction.
// The else statement is to prevent building the $offset array. else { $offset_count = 0; $new_count = $num_days_array; }
// count how many days we have with the two // previous arrays merged together $current_num = count($new_count);
// Since we will have 5 HTML table rows (TR) // with 7 table data entries (TD) // we need to fill in 35 TDs // so, we will have to figure out // how many days to appened to the end // of the final array to make it 35 days.
// Now let's "chunk" the $all_days array // into weeks. Each week has 7 days // so we will array_chunk it into 7 days. $weeks = array_chunk($new_count, 7);
// Close out your table and that's it! echo '<tr><td colspan="7" class="days"> </td></tr>'; echo '</table>'; ?> </body> </html> <---------------------------------------------------------------------------->
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.