Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $graphingFunction = function($months, $paymentPerMonth) {
- $addPaymentAndInterest = function ($payment) use ($paymentPerMonth) {
- static $last = 0;
- $interestRate = (rand(0, 100) / 20) / 100;
- $last = $paymentPerMonth + ($last * (1 + $interestRate));
- return $last;
- };
- return array_map($addPaymentAndInterest, array_fill(0, $months, $paymentPerMonth));
- };
- $graph = $graphingFunction(50, 100);
- var_dump($graph);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement