Draw a chessboard with chosen coords highlighted
<?php
echo "<table><tr><td>+</td>";
for ($letter = 1; $letter <= 8; $letter++)
{
echo "<td>". chr($letter+64) . "</td>";
}
echo "</tr>";
for ($square = 0; $square <72; $square++)
{
if ($square %9 == 0)
{
echo "</tr>\n<tr><th>".(8- intdiv($square , 9) )."</th>";
}
else
{
if ($square %2 == 1 )
{ echo "<td class='white'> </td>"; }
else
{ echo "<td class='black'> </td>"; }
}
}
echo "</tr></table>";
?>
| + | A | B | C | D | E | F | G | H |
| 8 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 6 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 5 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
| 4 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
| 3 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
| 2 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
| 1 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
|---|