Here you go, this should work.
PHP Code:
<?php
/**
* @desc Calculates the monthly payments of a loan
* based on the APR and Term.
*
* @param Float $fLoanAmount The loan amount.
* @param Float $fAPR The annual interest rate.
* @param Integer $iTerm The length of the loan in months.
* @return Float Monthly Payment.
*/
function calculateMonthlyPayments( $fLoanAmount , $fAPR, $iTerm )
{
return ($fLoanAmount/$iTerm)+(($fLoanAmount/$iTerm)/100*($fAPR/12*$iTerm));
}
echo calculateMonthlyPayments( 100, 8.9, 12 );
?>
Bookmarks