I want to replicate Excel's PPMT function in PHP but can't seem to get the same value. I've asked ChatGPT repeatedly and tried it out, but the values are different. I want to derive the same values in PHP as in Excel.
Excel conditions are as follows:
=D2+PPMT(B7,1,($B$1+1-A7),D2)
D2 = 10000
B7 = 8%
B1 = 5
A7 = 1
Value in Excel: 8295.44
=C7+PPMT(B8,1,($B$1+1-A8),C7)
C7 = 8295.44
B8 = 9%
B1 = 5
A8 = 2
Value in Excel: 6481.48
Please help me with this.