I am trying to come up with a formula in PHP programming cod
I am trying to come up with a formula in PHP programming code to calculate the future value of an investment at certain time periods. We are using HTML code to provide the user input and a seperate PHP file to receive input from the HTML file. The code will output a table that shows the investment period, present value of the investment during that period and the future value of the investment, at that given period. I have the user input and table output correct, but can\'t figure out how to calculate the numbers.
My PHP code is below, I have bolded the calculation that I need help with. The Future Value formula that is to be used is Vt+1 = Vt + i ......where i is the interest payment(not rate), calculated as i = Vt* r .... with the FV at time t becoming the PV at t+1
<html>
 <head><title>Future Investment Value</head></title>
 <body>
 <center><strong>Value of your investment at each period</strong></center>
 <?php
 $presentValue=$_POST[\'presentValue\'];
 $interestRate=$_POST[\'interestRate\'];
 $totalPeriods=$_POST[\'totalPeriods\'];
 print(\"<h1>Investment Calculator</h1>\");
 print(\"<table border = \\\"1\\\">\");
 print(\"<tr><td><strong>Period</strong></td>
  <td><strong>Present Value</strong></td>
 <td><strong>Total Value</strong></td></tr>\");
 for($counter=0; $counter<=$totalPeriods; $counter=$counter+1)
 {
    $futureValue=$presentValue + pow($presentValue * $interestRate, $counter);
    print(\"<tr><td align =\\\"center\\\">$counter</td>
    <td align=\\\"center\\\">$presentValue</td>
    <td align=\\\"center\\\">$futureValue</td></tr>\");
 }
 print(\"</table>\");
 ?>
 <a href=\"futureInvestmentValue.html\">Calculate another investment</a>
 </body>
 </html>
Solution
$futureValue=$presentValue +($presentValue*0.01*$interestRate*1)
Use this expression for each iteration I.e every year.
So time period in this expression is always 1

