-1

I found this formula written in CGI and I would very much like to convert this into PHP.

$affordability = $payment / ($monthly_interest / (1 - (1 + $monthly_interest) ** ($minus_terms))) ;

Unfortunately, PHP does not recognize the ** symbol, and I am wondering if someone can give me some shed of lights of how to convert this into PHP.

Nic
  • 12,220
  • 20
  • 77
  • 105
jobun
  • 157
  • 1
  • 11
  • possible duplicate of [Raising to power in PHP](http://stackoverflow.com/questions/1211514/raising-to-power-in-php) – JoshWillik Apr 20 '15 at 02:36

1 Answers1

1

That's the exponential operator.

In PHP you calculate exponents by using the pow() function:

$affordability = $payment / ($monthly_interest / (1 - pow(1 + $monthly_interest, $minus_terms)));
r3mainer
  • 23,981
  • 3
  • 51
  • 88