<?php
function getTotal($price, $amount, $rate = 1.1)
{
if($amount >= 100){
return $price * $amount;
}else{
return $price * $amount * $rate;
}
}
echo getTotal(100, 100) . PHP_EOL;
echo getTotal(1000, 10) . PHP_EOL;
<?php
function getTotal($price, $amount, $rate = 1.1)
{
if($amount >= 100){
return $price * $amount;
}else{
return $price * $amount * $rate;
}
}
echo getTotal(100, 100) . PHP_EOL;
echo getTotal(1000, 10) . PHP_EOL;