I am trying to build a count-down widget.
Given a certain date, whats the easiest way in PHP to determine how many days until that date?
<?php $cdate = mktime(0, 0, 0, 12, 31, 2009); $today = time(); $difference = $cdate - $today; if ($difference < 0) { $difference = 0; } echo floor($difference/60/60/24)." days remaining"; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With