How to create a multiplication table in PHP ? Well… Look at this!
$start = 15; $end = 30; echo '<table>'; echo '<tr><th></th>'; for ($x = $start; $x <= $end; $x++) echo '<th>'.$x.'</th>'; echo '</tr>'; for ($y = $start; $y <= $end; $y++): echo '<tr><th>'.$y.'</th>'; for ($z = $start; $z <= $end; $z++): echo '<td>'.($y * $z).'</td>'; endfor; echo '</tr>'; endfor; echo '</table>';
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)


» Latest comments