$aylar = date('m', $tarih) - date('m', $tarih2); $yillar = date('Y', $tarih) - date('Y', $tarih2); $fark = ($yillar*12) + $aylar; echo $fark;