Author Topic: PHP 5.3 - Decision of Strings (GM, GA, GE, GN decider)  (Read 16864 times)

Tayab

  • Full Member
  • ***
  • Posts: 149
PHP 5.3 - Decision of Strings (GM, GA, GE, GN decider)
« on: November 01, 2012, 02:33:29 AM »
Hello I've just created another script which decides whether to sat Good Morning, Afternoon, Evening, Night at suitable country. It's basic script with the complication in Hours. I might be wrong somewhere in hours according to my math skills. :P

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1-sttrict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Hello</title>
</head>
<body>

<?php 

$hour 
date"G" );
$yeardate"Y" );

    if ( 
$hour >= && $hour 12 ) {
echo 
"<h1>Good Morning!</h1>";
} elseif ( 
$hour >= 12 && $hour 18 ) {
 echo 
"<h1>Good Afternoon!</h1>";
} elseif ( 
$hour >= 18 && $hour 22 ) {
 echo 
"<h1>Good Evening!</h1>";
}else {
echo 
"<h1>Good Night!</h1>";
}
?>


</body>
</html>

phpdeveloper

  • Newbie
  • *
  • Posts: 39
Re: PHP 5.3 - Decision of Strings (GM, GA, GE, GN decider)
« Reply #1 on: November 01, 2012, 05:54:24 AM »
good job script is well no doubt  and any one can change the hours to according  his/her time when he /she want to  show (GM,GA,GE,GN )
thanks tayab to sharing with us . hope it will work well for other ....
« Last Edit: November 01, 2012, 05:56:29 AM by phpdeveloper »

Tayab

  • Full Member
  • ***
  • Posts: 149
Re: PHP 5.3 - Decision of Strings (GM, GA, GE, GN decider)
« Reply #2 on: November 20, 2012, 01:06:57 PM »
Thanks for your reply back of appreciation. Due to my busy schedule I was packed from 4s, along with I am working on something else too so I am unable to give sometime to it. But am planning to change it to dynamic (will show the time according to person's GMT) and hoping you will help me wherever I stuck. Secondly, I also will be creating fascinating things into PHP as along.

phpdeveloper

  • Newbie
  • *
  • Posts: 39
Re: PHP 5.3 - Decision of Strings (GM, GA, GE, GN decider)
« Reply #3 on: November 23, 2012, 06:25:22 AM »
Your welcome Tayab we are always ready to help you and best of luck for your dreams  :) :) :)

 

X

Do you know?

Just make posts in this community and win .com / .org / .net domain name free.
Know more..
Join Now!