Heey guys, I just got eveloved in PHP but, something I don't understand and I googled it but could not find it.
How can I count, $toshiba["prijs"] + $acer["prijs"] + $HP["prijs"] ?
Virusscans
[1],[2]
This is my code:
Code:
<html>
<head>
<title>LAB 2, les 4</title>
</head>
<body>
<header><b>HASH-arrays</b></header>
<?php
$toshiba["merk"] = " Toshiba Satellite ";
$toshiba["model"] = " A100 ";
$toshiba["OS"] = " Windows 8 ";
$toshiba["voorraad"] = 80;
$toshiba["prijs"] = 999;
$totaal = $toshiba["prijs"];
$acer["merk"] = " Acer Aspire ";
$acer["model"] = " 5732Z ";
$acer["OS"] = " Linux ";
$acer["voorraad"] = 0;
$acer["prijs"] = 888;
$HP["merk"] = " HP ";
$HP["model"] = " 200X ";
$HP["OS"] = " Windows Vista ";
$HP["voorraad"] = 50;
$HP["prijs"] = 777;
echo("<table border='1'> " . "
<caption>
<strong>SML laptops</strong>
</caption>
<thead>
<tr>
<th>Merk</th><th>Model</th><th>Operating System</th><th>Voorraad</th><th>Prijs</th>
</tr>
</thead>
<tbody>
<tr>
<td>" . $toshiba["merk"] . "</td>" . "
<td>" . $toshiba["model"]. "</td>" . "
<td>" . $toshiba["OS"] . "</td>" . "
<td>" . $toshiba["voorraad"] . "</td>" . "
<td>" . $toshiba["prijs"] . "</td>" . "
</tr>
<tr>
<td>" . $acer["merk"] . "</td>" . "
<td>" . $acer["model"]. "</td>" . "
<td>" . $acer["OS"] . "</td>" . "
<td>" . $acer["voorraad"] . "</td>" . "
<td>" . $acer["prijs"] . "</td>" . "
</tr>
<tr>
<td>" . $HP["merk"] . "</td>" . "
<td>" . $HP["model"]. "</td>" . "
<td>" . $HP["OS"] . "</td>" . "
<td>" . $HP["voorraad"] . "</td>" . "
<td>" . $HP["prijs"] . "</td>" . "
</tr>
<tfoot>
<tr>
<td colspan='4'>Totaal</td> <td> " . $totaal . "</td>
</tr>
</tfoot>
</tbody>
</table>");
?>
</body>
</html>