$departure
is 2014-06-02 and $date
is 2014-06-01. I actually ran this through a sandbox and it came out right. However, this is my output on the page: 2014-06-02 date: 2014-06-01 g: 16222
This is my code:
$days = 0;
$departure = strtotime($r['departure']);
echo $r['departure'];
echo " date: ".$date;
$datediff = abs(strtotime($date) - strtotime($departure));
$days = floor($datediff/(60*60*24));
echo " g: ".$days++;
So days should be 2
yet it is 16222
. What is going on here?