-1

Calculate months and years from given value in PHP framework CodeIgniter

EMI calculator:

enter image description here

Here I have a total months duration, but I need to find out when is come that month and year in CodeIgniter or PHP format.

piotr_cz
  • 8,755
  • 2
  • 30
  • 25
basil
  • 21
  • 11

1 Answers1

0

CI code update in date diff

 $datetime1 = date_create(date);
 $datetime2 = date_create(date);
 $interval = date_diff($datetime1,$datetime2);
 //echo $interval->format('%R%d days');
 echo $interval->format('%y years %m months %d day basil');
basil
  • 21
  • 11