Countdown To A Date in PHP

If you wish a script in PHP that will countdown the time you can use the following code:

$dtt_end = new DateTime('January 3, 2030 2:00 PM'); // the date to count down
$remain = $dtt_end->diff(new DateTime());
echo $remain->d . ' days, ' . $remain->h . ' hours';

So this is a simple refresh script that will show on the browser without any javascript, CSS or some other design….

If you wish something more complex you can start with this idea

Leave a Reply

Your email address will not be published. Required fields are marked *

tutorials