I need to put a code in php
where I report 2 dates and it returns the difference in months. Example:
$data1 = "2016-03-01";
$data2 = "2016-06-10";
Resultado 3 meses
Example 2:
$data1 = "2015-06-01";
$data2 = "2016-06-10";
Resultado 12 meses
Resolved like this: $ monthsAhead = $ interval-> m + ($ interval-> 12);