Answers for "php inline if condition date time"

PHP
0

php inline if condition date time

<?php 
     $deliverytime = new DateTime('2014-09-08 06:00:00');
     $hour = $deliverytime->format('H');
     if ($hour < 12) {
       echo "Morning";
     } else {
       echo "Afternoon or evening";
     }
?>
Posted by: Guest on September-28-2021

Browse Popular Code Answers by Language