Try this:
<?php
$datetime1 = date_create($start);
$datetime2 = date_create($end);
$interval = date_diff($datetime1, $datetime2);
return $interval->format('%a'); //returns the number of days
?>
1
solved How to calculate different between two date()? [duplicate]