note 51072 added to function.date

From: Date: Fri, 18 Mar 2005 18:08:52 +0000
Subject: note 51072 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-86633@lists.php.net to get a copy of this message
Hey everybody... This small script will help you to Show on the Web-Site a Message in accordance with the hour. Suppose It´s 9pm, I mean it shows this way, Ex.: [ Good Morning, Welcome to my Web-Site! ] - Script: <?php $hora = date("H"); if ($hora < 12) { //1st condition echo "Good Morning, Welcome to my Web-Site!"; //this message will show up until 11:59am } elseif (($hora >= 12) and( $hora < 18)){ //2nd condition echo "Good Afternoon, Welcome to my Web-Site!"; //this message will show up from 12pm until 17:59pm! } else { //3rd and last condition with a Else echo "Boa Evening, Welcome to my Web-Site!"; //this message, of course, :-) will show up in the rest time! } ?> I hope to help someone... see you! Denis Santana denislss@hotmail.com ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51072 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51072&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51072&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51072&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51072&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51072&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51072&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86633) next »