Last updated on November 16th, 2015 at 09:58 am

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

A simple script for this New Year . This php script will help us find the number of days between two dates. You can give date manually or pass dynamically.

//$start = strtotime('2012-12-31');
$start = time();
$end = strtotime('2013-01-03');
$days_between = ceil(($end - $start) / 86400);
echo $days_between;

Here i have given time() as the start variable. Also commented out one section with
//$start = strtotime(‘2012-12-31’);
You can use either one of those according to your convenience.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

Leave a Reply

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