Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create a PHP Countdown Timer
- http://www.programminghelp.com/php/create-php-countdown-timer/
- <!doctype html>
- <html>
- <head>
- <title>PHP Countdown Timer</title>
- <style>
- .green{color:green;}
- h1{
- font-size:3em;
- font-weight:bold;
- font-family:Arial, Helvetica, sans-serif;
- }
- </style>
- </head>
- <body>
- <?php
- $date = strtotime("December 3, 2014 2:00 PM");
- $remaining = $date - time();
- $days_remaining = floor($remaining / 86400);
- $hours_remaining = floor(($remaining % 86400) / 3600);
- ?>
- <h1>There are <span class="green"> <?php echo $days_remaining?></span> days and <span class="green"> <?php echo $hours_remaining?></span> hours left</h1>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement