How to find month difference between today and other date from database?

tyoujamleade

New Member
I have today date stored in variable $today=date("Y-m-d");and other variable which is date fetched from mysql database. $date2=(row['date2']);I have tried with date_diff:\[code\]$diff=$today-$date2;\[/code\]But $today is string and i cant find out a solution.I have tried with $today=newDateTime (date("Y-m-d"));And get an error: Object Of Class DateTime Could Not Be Converted To IntShould mention that after i get the month i need to store them in a variable and multiply with other variable.Any suggestions ?
 
Top