Mega Code Archive

 
Categories / Php / Code Snippets
 

A greeting based upon the time of day

<?php $theDate = date("H"); if($theDate < 12) echo "Good morning to you"; else if($theDate < 18) echo "Good afternoon to you"; else echo "Good evening to you"; ?>