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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -