标题for的高级运用
日期:2008-01-22    作者:semirock   来源:444p.com
文章打印自: PHP学习之家
访问文章完全地址: http://www.444p.com/example/php-example/aid1977/
头部广告
for的高级运用


<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>


责任编辑:semirock