Skip to content

Instantly share code, notes, and snippets.

@otanodesignco
Created June 20, 2013 17:27
Show Gist options
  • Save otanodesignco/5824764 to your computer and use it in GitHub Desktop.
Save otanodesignco/5824764 to your computer and use it in GitHub Desktop.
Php code that determines the payment on a loan. Taken from Visual Basic.
<?php
function RentalPayment($Principle, $IntRate, $PayPerYear, $NumYears)
{
$numer; $denom; $b; $e;
$numer = $IntRate * $Principle / $PayPerYear;
$e = -($PayPerYear * $NumYears);
$b = ($IntRate / $PayPerYear) + 1;
$denom = 1 - pow($b, $e);
return $numer / $denom;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment