Skip to content

Instantly share code, notes, and snippets.

@imjjss
Created May 11, 2013 09:28
Show Gist options
  • Save imjjss/5559431 to your computer and use it in GitHub Desktop.
Save imjjss/5559431 to your computer and use it in GitHub Desktop.
time counter with user input as start
list($hours, $minutes, $seconds) = explode(':', $_POST['time']);
$seconds = $hours * 3600 + $minutes * 60 + $seconds;
for ($i = $seconds; $i > 0; $i--)
{
echo $i;
sleep(1);
flush();
}
echo 'Countdown finished.';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment