<html>
<head>
<title>for的高級運用</title>
</head>
<body>
<?
/*
** 打印必要的說明文字
*/
print("<b>距離星期一還有幾天?</b>/n");
print("<ol>/n");
for($currentdate = date("u"); //定義$currentdate時間格式
date("l", $currentdate) != "monday"; //判斷是不是當前系統時間是monday
$currentdate += (60 * 60 * 24))//當前時間加上1天
{
/*
** 打印時間名稱
*/
print("<li>" . date("l", $currentdate) . "/n");
}
print("</ol>/n");
?>
</body>
</html>
新聞熱點
疑難解答