How can we know the number of days between two given dates using PHP?
May 28th, 20082 Comments
$date1 = date('Y-m-d');
$date2 = '2009-11-01';
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
echo "Number of days since '2006-07-01': $days";
$date2 = '2009-11-01';
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
echo "Number of days since '2006-07-01': $days";
Wednesday, May 28th, 2008 at 5:02 am
strtotime() funtion need parameter
Wednesday, May 28th, 2008 at 5:02 am
Thank , it is work perfectly