I'm attempting to create a PHP function that will calculate a loan's interest rate based on knowing $total_loan_amount, $total_number_of_payments, and $payment_amount.
I have found a website with the a JS calculator for this, and includes the function I need to use.
https://www.easycalculation.com/mortgage/interest-rate.php
However, I'm having a difficult time trying to figure out how to translate this to PHP. I'm getting hung up on calculating q, and specifically the 'divide by log2' portion.
Anyone have any suggestions on how to write the q = formula in PHP?
Cheers