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