Kiwango cha 6.8 cha Kikokotoo cha Kazi za PHP
Umepata maandishi. Ukifika kwenye ukurasa, pakia kila herufi ya maandishi kwa rangi ya bahati nasibu ili herufi za jirani ziwe na rangi tofauti. Matokeo yake yatajwe kwenye aya.
Umepata safu ifuatayo:
<?php
$arr = [
['name' => 'prod1', 'price' => 100, 'amount' => 1],
['name' => 'prod2', 'price' => 200, 'amount' => 2],
['name' => 'prod3', 'price' => 300, 'amount' => 3],
];
?>
Tengenezza kwa kutumia safu hii msimbo ufuatao:
<table>
<thead>
<tr>
<th>bidhaa</th>
<td>bei</td>
<td>kiasi</td>
<td>jumla</td>
</tr>
</thead>
<tbody>
<tr>
<td>prod1</td>
<td>100</td>
<td>1</td>
<td>100</td>
</tr>
<tr>
<td>prod2</td>
<td>200</td>
<td>2</td>
<td>400</td>
</tr>
<tr>
<td>prod3</td>
<td>300</td>
<td>3</td>
<td>900</td>
</tr>
</tbody>
</table>
<br>
jumla: <span>1400</span>