I am using this code:
//get days
$a = date_create($arrive);
$d = date_create($leave);
//$days = date_diff($d,$a);
echo '<input type="hidden" id="days" value="'.date_diff($d,$a).'"/>';
and getting this error: Catchable fatal error: Object of class DateInterval could not be converted to string
I do not know how to fix the issue.