Here's a simple PHP code for an amortizing loan calculator

<?php
$principal = 100000; // loan amount
$interestRate = 5; // interest rate
$term = 360; // loan term in months
$monthlyPayment = ($principal * ($interestRate/1200)) / (1 - pow(1 + ($interestRate/1200), -$term));
$balance = $principal;

echo "<table>";
echo "<tr><th>Month</th><th>Payment</th><th>Principal</th><th>Interest</th><th>Balance</th></tr>";
for ($i = 1; $i <= $term; $i++) {
    $interest = $balance * ($interestRate/1200);
    $principal = $monthlyPayment - $interest;
    $balance = $balance - $principal;
    echo "<tr><td>".$i."</td><td>$".number_format($monthlyPayment, 2)."</td><td>$".number_format($principal, 2)."</td><td>$".number_format($interest, 2)."</td><td>$".number_format($balance, 2)."</td></tr>";
}
echo "</table>";
?>

This code calculates the monthly payment for a loan using the given principal, interest rate, and term in months. It then iterates over the loan term, calculating the principal, interest, and balance for each month, and displays the results in a table. The number_format() function is used to format the output to two decimal places. You can modify the values of $principal, $interestRate, and $term to fit your specific loan details.

Example: 

MonthPaymentPrincipalInterestBalance
1$536.82$120.15$416.67$99,879.85
2$536.82$120.66$416.17$99,759.19
3$536.82$121.16$415.66$99,638.03
4$536.82$121.66$415.16$99,516.37
5$536.82$122.17$414.65$99,394.20
6$536.82$122.68$414.14$99,271.52
7$536.82$123.19$413.63$99,148.33
8$536.82$123.70$413.12$99,024.62
9$536.82$124.22$412.60$98,900.41
10$536.82$124.74$412.09$98,775.67
11$536.82$125.26$411.57$98,650.41
12$536.82$125.78$411.04$98,524.63
13$536.82$126.30$410.52$98,398.33
14$536.82$126.83$409.99$98,271.50
15$536.82$127.36$409.46$98,144.15
16$536.82$127.89$408.93$98,016.26
17$536.82$128.42$408.40$97,887.84
18$536.82$128.96$407.87$97,758.88
19$536.82$129.49$407.33$97,629.39
20$536.82$130.03$406.79$97,499.36
21$536.82$130.57$406.25$97,368.78
22$536.82$131.12$405.70$97,237.66
23$536.82$131.66$405.16$97,106.00
24$536.82$132.21$404.61$96,973.79
25$536.82$132.76$404.06$96,841.02
26$536.82$133.32$403.50$96,707.71
27$536.82$133.87$402.95$96,573.83
28$536.82$134.43$402.39$96,439.40
29$536.82$134.99$401.83$96,304.41
30$536.82$135.55$401.27$96,168.86
31$536.82$136.12$400.70$96,032.74
32$536.82$136.69$400.14$95,896.05
33$536.82$137.25$399.57$95,758.80
34$536.82$137.83$398.99$95,620.97
35$536.82$138.40$398.42$95,482.57
36$536.82$138.98$397.84$95,343.59
37$536.82$139.56$397.26$95,204.04
38$536.82$140.14$396.68$95,063.90
39$536.82$140.72$396.10$94,923.18
40$536.82$141.31$395.51$94,781.87
41$536.82$141.90$394.92$94,639.97
42$536.82$142.49$394.33$94,497.48
43$536.82$143.08$393.74$94,354.40
44$536.82$143.68$393.14$94,210.72
45$536.82$144.28$392.54$94,066.45
46$536.82$144.88$391.94$93,921.57
47$536.82$145.48$391.34$93,776.09
48$536.82$146.09$390.73$93,630.00
49$536.82$146.70$390.12$93,483.30
50$536.82$147.31$389.51$93,335.99
51$536.82$147.92$388.90$93,188.07
52$536.82$148.54$388.28$93,039.53
53$536.82$149.16$387.66$92,890.38
54$536.82$149.78$387.04$92,740.60
55$536.82$150.40$386.42$92,590.20
56$536.82$151.03$385.79$92,439.17
57$536.82$151.66$385.16$92,287.51
58$536.82$152.29$384.53$92,135.22
59$536.82$152.92$383.90$91,982.29
60$536.82$153.56$383.26$91,828.73
61$536.82$154.20$382.62$91,674.53
62$536.82$154.84$381.98$91,519.69
63$536.82$155.49$381.33$91,364.20
64$536.82$156.14$380.68$91,208.06
65$536.82$156.79$380.03$91,051.27
66$536.82$157.44$379.38$90,893.83
67$536.82$158.10$378.72$90,735.73
68$536.82$158.76$378.07$90,576.98
69$536.82$159.42$377.40$90,417.56
70$536.82$160.08$376.74$90,257.48
71$536.82$160.75$376.07$90,096.73
72$536.82$161.42$375.40$89,935.31
73$536.82$162.09$374.73$89,773.22
74$536.82$162.77$374.06$89,610.45
75$536.82$163.44$373.38$89,447.01
76$536.82$164.13$372.70$89,282.88
77$536.82$164.81$372.01$89,118.07
78$536.82$165.50$371.33$88,952.58
79$536.82$166.19$370.64$88,786.39
80$536.82$166.88$369.94$88,619.51
81$536.82$167.57$369.25$88,451.94
82$536.82$168.27$368.55$88,283.67
83$536.82$168.97$367.85$88,114.69
84$536.82$169.68$367.14$87,945.02
85$536.82$170.38$366.44$87,774.63
86$536.82$171.09$365.73$87,603.54
87$536.82$171.81$365.01$87,431.73
88$536.82$172.52$364.30$87,259.21
89$536.82$173.24$363.58$87,085.97
90$536.82$173.96$362.86$86,912.00
91$536.82$174.69$362.13$86,737.31
92$536.82$175.42$361.41$86,561.90
93$536.82$176.15$360.67$86,385.75
94$536.82$176.88$359.94$86,208.87
95$536.82$177.62$359.20$86,031.25
96$536.82$178.36$358.46$85,852.89
97$536.82$179.10$357.72$85,673.79
98$536.82$179.85$356.97$85,493.95
99$536.82$180.60$356.22$85,313.35
100$536.82$181.35$355.47$85,132.00
101$536.82$182.10$354.72$84,949.89
102$536.82$182.86$353.96$84,767.03
103$536.82$183.63$353.20$84,583.40
104$536.82$184.39$352.43$84,399.01
105$536.82$185.16$351.66$84,213.85
106$536.82$185.93$350.89$84,027.92
107$536.82$186.71$350.12$83,841.22
108$536.82$187.48$349.34$83,653.74
109$536.82$188.26$348.56$83,465.47
110$536.82$189.05$347.77$83,276.42
111$536.82$189.84$346.99$83,086.59
112$536.82$190.63$346.19$82,895.96
113$536.82$191.42$345.40$82,704.54
114$536.82$192.22$344.60$82,512.32
115$536.82$193.02$343.80$82,319.30
116$536.82$193.82$343.00$82,125.47
117$536.82$194.63$342.19$81,930.84
118$536.82$195.44$341.38$81,735.40
119$536.82$196.26$340.56$81,539.14
120$536.82$197.08$339.75$81,342.06
121$536.82$197.90$338.93$81,144.17
122$536.82$198.72$338.10$80,945.45
123$536.82$199.55$337.27$80,745.90
124$536.82$200.38$336.44$80,545.52
125$536.82$201.22$335.61$80,344.30
126$536.82$202.05$334.77$80,142.25
127$536.82$202.90$333.93$79,939.35
128$536.82$203.74$333.08$79,735.61
129$536.82$204.59$332.23$79,531.02
130$536.82$205.44$331.38$79,325.58
131$536.82$206.30$330.52$79,119.28
132$536.82$207.16$329.66$78,912.12
133$536.82$208.02$328.80$78,704.10
134$536.82$208.89$327.93$78,495.21
135$536.82$209.76$327.06$78,285.46
136$536.82$210.63$326.19$78,074.82
137$536.82$211.51$325.31$77,863.31
138$536.82$212.39$324.43$77,650.92
139$536.82$213.28$323.55$77,437.65
140$536.82$214.16$322.66$77,223.48
141$536.82$215.06$321.76$77,008.43
142$536.82$215.95$320.87$76,792.47
143$536.82$216.85$319.97$76,575.62
144$536.82$217.76$319.07$76,357.86
145$536.82$218.66$318.16$76,139.20
146$536.82$219.57$317.25$75,919.62
147$536.82$220.49$316.33$75,699.13
148$536.82$221.41$315.41$75,477.73
149$536.82$222.33$314.49$75,255.39
150$536.82$223.26$313.56$75,032.14
151$536.82$224.19$312.63$74,807.95
152$536.82$225.12$311.70$74,582.83
153$536.82$226.06$310.76$74,356.77
154$536.82$227.00$309.82$74,129.77
155$536.82$227.95$308.87$73,901.82
156$536.82$228.90$307.92$73,672.92
157$536.82$229.85$306.97$73,443.07
158$536.82$230.81$306.01$73,212.26
159$536.82$231.77$305.05$72,980.49
160$536.82$232.74$304.09$72,747.75
161$536.82$233.71$303.12$72,514.05
162$536.82$234.68$302.14$72,279.37
163$536.82$235.66$301.16$72,043.71
164$536.82$236.64$300.18$71,807.07
165$536.82$237.63$299.20$71,569.45
166$536.82$238.62$298.21$71,330.83
167$536.82$239.61$297.21$71,091.22
168$536.82$240.61$296.21$70,850.61
169$536.82$241.61$295.21$70,609.00
170$536.82$242.62$294.20$70,366.38
171$536.82$243.63$293.19$70,122.76
172$536.82$244.64$292.18$69,878.11
173$536.82$245.66$291.16$69,632.45
174$536.82$246.69$290.14$69,385.76
175$536.82$247.71$289.11$69,138.05
176$536.82$248.75$288.08$68,889.30
177$536.82$249.78$287.04$68,639.52
178$536.82$250.82$286.00$68,388.70
179$536.82$251.87$284.95$68,136.83
180$536.82$252.92$283.90$67,883.91
181$536.82$253.97$282.85$67,629.94
182$536.82$255.03$281.79$67,374.91
183$536.82$256.09$280.73$67,118.81
184$536.82$257.16$279.66$66,861.65
185$536.82$258.23$278.59$66,603.42
186$536.82$259.31$277.51$66,344.11
187$536.82$260.39$276.43$66,083.73
188$536.82$261.47$275.35$65,822.25
189$536.82$262.56$274.26$65,559.69
190$536.82$263.66$273.17$65,296.04
191$536.82$264.75$272.07$65,031.28
192$536.82$265.86$270.96$64,765.42
193$536.82$266.97$269.86$64,498.46
194$536.82$268.08$268.74$64,230.38
195$536.82$269.20$267.63$63,961.18
196$536.82$270.32$266.50$63,690.87
197$536.82$271.44$265.38$63,419.42
198$536.82$272.57$264.25$63,146.85
199$536.82$273.71$263.11$62,873.14
200$536.82$274.85$261.97$62,598.29
201$536.82$276.00$260.83$62,322.30
202$536.82$277.15$259.68$62,045.15
203$536.82$278.30$258.52$61,766.85
204$536.82$279.46$257.36$61,487.39
205$536.82$280.62$256.20$61,206.77
206$536.82$281.79$255.03$60,924.97
207$536.82$282.97$253.85$60,642.00
208$536.82$284.15$252.68$60,357.86
209$536.82$285.33$251.49$60,072.53
210$536.82$286.52$250.30$59,786.01
211$536.82$287.71$249.11$59,498.29
212$536.82$288.91$247.91$59,209.38
213$536.82$290.12$246.71$58,919.27
214$536.82$291.32$245.50$58,627.94
215$536.82$292.54$244.28$58,335.40
216$536.82$293.76$243.06$58,041.65
217$536.82$294.98$241.84$57,746.66
218$536.82$296.21$240.61$57,450.45
219$536.82$297.44$239.38$57,153.01
220$536.82$298.68$238.14$56,854.33
221$536.82$299.93$236.89$56,554.40
222$536.82$301.18$235.64$56,253.22
223$536.82$302.43$234.39$55,950.79
224$536.82$303.69$233.13$55,647.09
225$536.82$304.96$231.86$55,342.13
226$536.82$306.23$230.59$55,035.90
227$536.82$307.51$229.32$54,728.40
228$536.82$308.79$228.03$54,419.61
229$536.82$310.07$226.75$54,109.54
230$536.82$311.37$225.46$53,798.17
231$536.82$312.66$224.16$53,485.51
232$536.82$313.97$222.86$53,171.55
233$536.82$315.27$221.55$52,856.27
234$536.82$316.59$220.23$52,539.68
235$536.82$317.91$218.92$52,221.78
236$536.82$319.23$217.59$51,902.55
237$536.82$320.56$216.26$51,581.99
238$536.82$321.90$214.92$51,260.09
239$536.82$323.24$213.58$50,936.85
240$536.82$324.58$212.24$50,612.27
241$536.82$325.94$210.88$50,286.33
242$536.82$327.30$209.53$49,959.04
243$536.82$328.66$208.16$49,630.38
244$536.82$330.03$206.79$49,300.35
245$536.82$331.40$205.42$48,968.94
246$536.82$332.78$204.04$48,636.16
247$536.82$334.17$202.65$48,301.99
248$536.82$335.56$201.26$47,966.43
249$536.82$336.96$199.86$47,629.46
250$536.82$338.37$198.46$47,291.10
251$536.82$339.78$197.05$46,951.32
252$536.82$341.19$195.63$46,610.13
253$536.82$342.61$194.21$46,267.52
254$536.82$344.04$192.78$45,923.48
255$536.82$345.47$191.35$45,578.01
256$536.82$346.91$189.91$45,231.09
257$536.82$348.36$188.46$44,882.73
258$536.82$349.81$187.01$44,532.92
259$536.82$351.27$185.55$44,181.66
260$536.82$352.73$184.09$43,828.92
261$536.82$354.20$182.62$43,474.72
262$536.82$355.68$181.14$43,119.05
263$536.82$357.16$179.66$42,761.89
264$536.82$358.65$178.17$42,403.24
265$536.82$360.14$176.68$42,043.10
266$536.82$361.64$175.18$41,681.46
267$536.82$363.15$173.67$41,318.31
268$536.82$364.66$172.16$40,953.65
269$536.82$366.18$170.64$40,587.46
270$536.82$367.71$169.11$40,219.76
271$536.82$369.24$167.58$39,850.52
272$536.82$370.78$166.04$39,479.74
273$536.82$372.32$164.50$39,107.42
274$536.82$373.87$162.95$38,733.54
275$536.82$375.43$161.39$38,358.11
276$536.82$377.00$159.83$37,981.11
277$536.82$378.57$158.25$37,602.55
278$536.82$380.14$156.68$37,222.40
279$536.82$381.73$155.09$36,840.68
280$536.82$383.32$153.50$36,457.36
281$536.82$384.92$151.91$36,072.44
282$536.82$386.52$150.30$35,685.92
283$536.82$388.13$148.69$35,297.79
284$536.82$389.75$147.07$34,908.04
285$536.82$391.37$145.45$34,516.67
286$536.82$393.00$143.82$34,123.67
287$536.82$394.64$142.18$33,729.03
288$536.82$396.28$140.54$33,332.75
289$536.82$397.94$138.89$32,934.81
290$536.82$399.59$137.23$32,535.22
291$536.82$401.26$135.56$32,133.96
292$536.82$402.93$133.89$31,731.03
293$536.82$404.61$132.21$31,326.42
294$536.82$406.29$130.53$30,920.12
295$536.82$407.99$128.83$30,512.14
296$536.82$409.69$127.13$30,102.45
297$536.82$411.39$125.43$29,691.05
298$536.82$413.11$123.71$29,277.95
299$536.82$414.83$121.99$28,863.12
300$536.82$416.56$120.26$28,446.56
301$536.82$418.29$118.53$28,028.26
302$536.82$420.04$116.78$27,608.23
303$536.82$421.79$115.03$27,186.44
304$536.82$423.54$113.28$26,762.89
305$536.82$425.31$111.51$26,337.58
306$536.82$427.08$109.74$25,910.50
307$536.82$428.86$107.96$25,481.64
308$536.82$430.65$106.17$25,050.99
309$536.82$432.44$104.38$24,618.55
310$536.82$434.24$102.58$24,184.31
311$536.82$436.05$100.77$23,748.25
312$536.82$437.87$98.95$23,310.38
313$536.82$439.70$97.13$22,870.69
314$536.82$441.53$95.29$22,429.16
315$536.82$443.37$93.45$21,985.79
316$536.82$445.21$91.61$21,540.58
317$536.82$447.07$89.75$21,093.51
318$536.82$448.93$87.89$20,644.58
319$536.82$450.80$86.02$20,193.77
320$536.82$452.68$84.14$19,741.09
321$536.82$454.57$82.25$19,286.53
322$536.82$456.46$80.36$18,830.07
323$536.82$458.36$78.46$18,371.70
324$536.82$460.27$76.55$17,911.43
325$536.82$462.19$74.63$17,449.24
326$536.82$464.12$72.71$16,985.12
327$536.82$466.05$70.77$16,519.07
328$536.82$467.99$68.83$16,051.08
329$536.82$469.94$66.88$15,581.14
330$536.82$471.90$64.92$15,109.24
331$536.82$473.87$62.96$14,635.37
332$536.82$475.84$60.98$14,159.53
333$536.82$477.82$59.00$13,681.71
334$536.82$479.81$57.01$13,201.89
335$536.82$481.81$55.01$12,720.08
336$536.82$483.82$53.00$12,236.26
337$536.82$485.84$50.98$11,750.42
338$536.82$487.86$48.96$11,262.56
339$536.82$489.89$46.93$10,772.66
340$536.82$491.94$44.89$10,280.73
341$536.82$493.99$42.84$9,786.74
342$536.82$496.04$40.78$9,290.70
343$536.82$498.11$38.71$8,792.59
344$536.82$500.19$36.64$8,292.40
345$536.82$502.27$34.55$7,790.13
346$536.82$504.36$32.46$7,285.77
347$536.82$506.46$30.36$6,779.31
348$536.82$508.57$28.25$6,270.73
349$536.82$510.69$26.13$5,760.04
350$536.82$512.82$24.00$5,247.22
351$536.82$514.96$21.86$4,732.26
352$536.82$517.10$19.72$4,215.16
353$536.82$519.26$17.56$3,695.90
354$536.82$521.42$15.40$3,174.47
355$536.82$523.59$13.23$2,650.88
356$536.82$525.78$11.05$2,125.10
357$536.82$527.97$8.85$1,597.14
358$536.82$530.17$6.65$1,066.97
359$536.82$532.38$4.45$534.59
360$536.82$534.59$2.23$0.00

Related Articles

- All From ChatGPT
PLG_GSPEECH_SPEECH_BLOCK_TITLE