serif'; mso-shading: white; mso-pattern: gray-15 auto"> date('y') 詏定 $start_year 變數以及 $end_year 變數,讓我們能夠方便計算今年算起十年前以及十年後的時間範圍。
下面是處理表單的函數:
<?php
function process_form() {
global $dotw;
global $month;
global $day;
global $year;
$timestamp = mktime(0,0,0,$month,$day,$year);
$next_dotw = '';
$next_timestamp = $timestamp;
while ($next_dotw != $dotw) {
$next_timestamp += 86400;
$next_dotw = date('l',$next_timestamp);
}
$formatted_first = date('f d, y',$timestamp);
$formatted_next = date('f d, y',$next_timestamp);
echo "the first $dotw after $formatted_first is $formatted_next.";
}