fork download
  1. <?php
  2.  
  3. // your code goes here
  4.  
  5. $t1 = new DateTime("4:30pm");
  6. $t2 = new DateTime("8:30pm");
  7.  
  8.  
  9. function todayTonight($t) {
  10. return (new DateTime("6:00pm") < $t) ? "Tonight" : "Today";
  11. }
  12.  
  13. echo todayTonight($t1) . "\n";
  14. echo todayTonight($t2) . "\n";
  15.  
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
Today
Tonight