note 70259 added to language.control-structures
| From: | (at) | Date: | Mon, 09 Oct 2006 06:43:32 +0000 |
| Subject: | note 70259 added to language.control-structures | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118234@lists.php.net to get a copy of this message | ||
A quick way to make something available only during certain hours. I'm brand new at this, so if
there's an error, please say so, but this works for me. You can also use 'include'
and probably other functions in place of 'echo'.
<?php
$d=date("H"); // 'H' is military time 00-24
if ($d >= "00" && $d <= "10") //between 12am and 10am
echo "Have a nice weekend!"; // @include works too :D
?>
----
Server IP: 64.71.164.2
Probable Submitter: 70.153.37.75
----
Manual Page -- http://www.php.net/manual/en/language.control-structures.php
Edit -- https://master.php.net/note/edit/70259
Del: integrated -- https://master.php.net/note/delete/70259/integrated
Del: useless -- https://master.php.net/note/delete/70259/useless
Del: bad code -- https://master.php.net/note/delete/70259/bad+code
Del: spam -- https://master.php.net/note/delete/70259/spam
Del: non-english -- https://master.php.net/note/delete/70259/non-english
Del: in docs -- https://master.php.net/note/delete/70259/in+docs
Del: other reasons-- https://master.php.net/note/delete/70259
Reject -- https://master.php.net/note/reject/70259
Search -- https://master.php.net/manage/user-notes.php