Jump to content

looking for a php script


pouncer

Recommended Posts

[url=http://uk2.php.net/time]time()[/url] will do the job. [url=http://uk2.php.net/date]date()[/url] will do the job too, probably easier. as i'm generous:

[code]
<?php
// get the current hour (24hr format)
$hour_of_day = date('H');

$output = 'Good ';

if ($hour_of_day < 12) // 12pm
{
   $output .= 'morning';
}
else
if ($hour_of_day < 17) // 5pm
{
   $output .= 'afternoon';
}
else
{
   $output .= 'evening';
}

echo $output;
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.