english

learn php

learn css

learn html

learn javascript

learn php

2. basics

solution 2.2
1 minute / 75 words

two / solution 2.2

<?php

$br = "\n";

$item1name = "t-shirt";
$item1cost = 24.9;

$item2name = "hoodie";
$item2cost = 46.24;

$item3name = "jeans";
$item3cost = 80.75;

$item4name = "belt";
$item4cost = 26.05;

$subtotal = $item1cost + $item2cost + $item3cost + $item4cost;

$taxrate = 15;
$tax = ($subtotal * $taxrate) / 100;

$total = $subtotal + $tax;

$receipt = $item1name . " $" . $item1cost . $br . $item2name . " $" . $item2cost . $br . $item3name . " $" . $item3cost . $br . $item4name . " $" . $item4cost . $br . $br . "subtotal $" . $subtotal . $br . "tax $" . $tax . $br . "total $" . $total;

print_r($receipt);

learn php

learn css

learn html

learn javascript

powered by akelei. an avi sato project.