You can calculate the difference in dates per day using this function
function diff_date_day($day , $month , $year , $day2 , $month2 , $year2){ $timestamp = mktime(0, 0, 0, $month, $day, $year, 0); $timestamp2 = mktime(0, 0, 0, $month2, $month2, $year2); $diff = floor(($timestamp - $timestamp2) / (3600 * 24)); return $diff; }
Suppose the average month is 30 days and calculates the number of months. This may be enough for some needs (showing the age of the blog comments, etc.) and completely unsuitable for others.
source share