- <html>
- <head>
- <title>if...else 判斷式</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- </head>
- <body>
- <?php
- date_default_timezone_set("America/New_York"); //Asia/Taipei America/New_York Pacific/Honolulu Europe/London
- echo "現在時刻: ".date("D, F j, Y, H:i:s")."<p/>";
- if(date("H")>=6 && date("H")<18)
- {
- echo "歡迎光臨!<p/>";
- }else
- {
- echo "明天請早!<p/>";
- }
- ?>
- </body>
- </html>
複製代碼 |