PHP daily countdown timer server side -
i have question php code took answer: timer, timezone, server side time, client side countdown modified php code own usages:
$now = new datetime; $boss1 = new datetime('07:50'); $boss2 = new datetime('11:50'); $boss3 = new datetime('23:50'); // next time night if( $now > $boss1 && $now < $boss2) { $time = $now->diff($boss2); } // next time day else if( $now > $boss2 && $now < $boss3) { $time = $now->diff($boss3); } else { $time = $now->diff($boss1); } $target = $time->format('%h:%i:%s'); echo "<b>next boss fight:</b> " . $target;
at moment, goes down in time when refresh page. here can have on page (it mobile use): my website wondering, how let countdown without refreshing page?
Comments
Post a Comment