src/Transformatika/Utility/Fn.php
public static function countMonthBetweenDate($startDate, $endDate)
    {
    	$d1 = strtotime($startDate);
		$d2 = strtotime($endDate);
		$min_date = min($d1, $d2);
		$max_date = max($d1, $d2);
		$i = 0;

		while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
		    $i++;
		}
		echo $i;
    }
public static function countMonthBetweenDate($startDate, $endDate)
    {
    	$d1 = strtotime($startDate);
		$d2 = strtotime($endDate);
		$min_date = min($d1, $d2);
		$max_date = max($d1, $d2);
		$i = 0;

		while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
		    $i++;
		}
		echo $i;
    }
public static function countMonthBetweenDate ( $ startDate , $ endDate ) { $ d1 = strtotime ( $ startDate ) ; $ d2 = strtotime ( $ endDate ) ; $ min_date = min ( $ d1 , $ d2 ) ; $ max_date = max ( $ d1 , $ d2 ) ; $ i = 0 ; while ( ( $ min_date = strtotime ( "+1 MONTH" , $ min_date ) ) <= $ max_date ) { $ i ++ ; } echo $ i ; }
Count Month Between Date
@param  Date
@param  Date
@return Integer
Count Month Between Date