<?php function calc_compound_interest($a, $r, $f, $y) { return $a * pow((1 + ($r / $f)), ($f * $y)); } echo calc_compound_interest(5000, .0325, 365, 3), '<br />'; ?>