- <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
- if(date("H")>=6 && date("H")<18)
- {
- echo "歡迎光臨!<p/>";
- }else
- {
- echo "明天請早!<p/>";
- }
- echo date('D, F j, Y, H:i:s A');
- ?>
- </body>
- </html>
複製代碼 |