I need to get the number of years from 2 dates provided. Here\'s my code:
function daysDifference($endDate, $beginDate) { $date_parts1=explode(\"-\", $beg
$d1 = new DateTime('2011-03-12'); $d2 = new DateTime('2008-03-09'); $diff = $d2->diff($d1); echo $diff->y;