'; for ($i = 0; $i < 3; $i ++){ echo ""; for ($j = 0; $j < 3; $j ++){ echo ""; $pos = 3*$i + $j; if ($grid[$pos] == 0) echo ""; if ($grid[$pos] == 1) echo ''; if ($grid[$pos] == 2) echo ''; echo ""; } echo ""; } echo ""; }