Possible Duplicates:
Difference between dates
How to calculate the date difference between 2 dates using php
So, I have two dates. For instance, 2010-09-24
and 2010-09-25
. I want to check if between those two dates the difference is 1 day.
I don't need to get a value of 86400
which means one day in seconds.
Don't forget that it can be 28, 28, 29, 30, 31 days in month.
Thanks.
What I have right now, but it doesn't work when there is difference between months:
$strto = strtotime($date);
$d1 = date('d', $strto);
$d2 = date('d', time());
echo $d2- $d1;