PHP - schedule element

0 votes
237 views
added Aug 20, 2018 in PHP by LC Marshal Captain (25,790 points)
//Once the promotion day is over, return the element to default
<?php
  $today      = date('c');
  $startdate  = date('c', mktime(0,0,0,6,14,2018)); // Example: Hour, Minute, Second, Month, Day, Year
  $enddate    = date('c', mktime(23,59,59,6,17,2018));
  if ($today >= $startdate && $today < $enddate) :
?>
  <h5 style="font-size:1.3rem">Sayangi Malaysiaku - Malaysia is ours!</h5>
<?php else :?>
  <h5>The one-stop destination for all things property - news, sale, rent, insights</h5>
<?php endif;?>  

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...