PHP Datediff days involved
- by user3549835
I need to know how many days are involved in a date diff. \For example:
<?
$start = new DateTime('2014-06-29 14:00:00');
$ende = new DateTime('2014-07-02 05:45:00');
$diff = $start->diff($ende);
echo $diff->format('%R');
echo $diff->days;
?>
The above code echos +2
My desired result would be 4, because the 29th, 30th, 1st and 2nd of July are "touched".
I have no idea to achieve that with the given functions. Coding a day-subtraction seems to bean open door for errors.