Tuesday, 20 March 2012

if timings

<html>
<title>if date function </title>
<body>
<?php
echo "hi, mom. ";
$var = date("H");
if ($var <=11)
{
    echo "GOOD MORNING!";
}
elseif ($var >11 and $var<18)
{
    echo "GOOD AFTERNOON!";
}
else
{
    echo "GOOD EVENING!";
}
?>
</body>
</html>

output
hi, mom. GOOD AFTERNOON!

No comments:

Post a Comment