PHP - How can I round off the date
<p>I am calculating the difference of two dates like this:</p>

<pre><code>$date1= $_POST['dob'];
$date2= $_POST['dor'];

$date1 = date_create($date1);
$date2 = date_create($date2);


$diff = $date1-&gt;diff($date2);
echo "&lt;p&gt; The difference is " . $diff-&gt;format('%y Years, %m month, %d days') . "&lt;/p&gt;";
</code></pre>

<p>Now, I want the difference to round up, for instance if the difference is calculated as:</p>

<p>40 Years, 0 month, 01 days</p>

<p>I want this to be treated as '41 Years'. Anything above the year will make it to roundup.</p>

<p>Any solutions?</p>