Program humanization, Web site humanization, is the pursuit of programmers, such as the design of PHP website, in the page to add a piece of such code, may be more humane. take advantage of PHP's simple judgment and read a little gadget written at the current time. It's boring, but it feels good.
Add a user-friendly reminder with the following code:
<?php date_default_timezone_set (' PRC '); Set China time zone if (0<=date (' h ') && date (' h ') <7) { echo "Good morning! Late at night, rest early! ";} if (7<=date (' h ') && date (' h ') <12) { echo "Good morning! A good day has begun, come on. ";} if (12<=date (' h ') && date (' h ') <16) { echo "Good afternoon! Have a cup of afternoon tea for a rest. ";} if (16<=date (' h ') && date (' h ') <19) { echo "Good afternoon! Have a good time in the afternoon. ";} if (19<=date (' h ') && date (' h ') <21) { echo "Good evening! It's time to relax after dinner. ";} if (21<=date (' h ') && date (' h ') <23) { echo "Good evening! What have you learned from the busy day? ";}? >
Get current time, week
<?php $atime =date ("Y year M D Day"); $week = Array (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); Echo $atime; echo $week [Date (w)];? >
OK, you can upload it.
Web site more user-friendly---Let PHP judge time and week