echo ""; echo ""; foreach ($salary as $name => $amount) { $tax_rate = $amount > 420000 ? 5 : 3.5; $tax_amount = $amount * $tax_rate / 100; echo ""; } echo "
NameYearly SalaryTax %Tax Amount
$name$amount$tax_rate%$tax_amount
";