PHP入门必读[62]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 chamrock 的 blog

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.";
}

本文关键:PHP入门必读
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top