How to Calculate Simple Interest with Example in PHP
How to calculate simple interest with example in PHP.
In this article, you will learn how to calculate simple interest with examples in PHP.
Simple Interest Formula
<?php // How to Calculate Simple Interest with Example in PHP $p = 5; $t = 7; $r = 9; $SI = NULL; // $p=principal, $t=time, $r=rate, $SI=simple interest // It will calculate the simple interest $SI = ($p * $t * $r) / 100; // It will print the final output echo "Simple Interest = " . $SI; ?>
In this given program we have taken input variables named with their values
$p = 5,
$t = 7, and
$r = 9. After that, we applied the standard formula to calculate the simple interest.
Then It will return the
3.15 simple interest of the above program.