 <p>how the code would be written greatly depends on where this array of 2 letter strings you have is coming from...but here is a self-contained example with some randomly generated 2 letter strings:</p> <pre><code>$strings = range('A','Z'); for ($a = 0;$a &lt; 100; $a++) { $array[] = $strings[rand(0,25)] . $strings[rand(0,25)]; } for ($table = 1; $table &lt;= 4; $table++) { $count = 0; $tarray = $array; echo "table " . $table . "&lt;br/&gt;"; echo "&lt;table border='1'&gt;"; for ($x = 0; $x &lt; 10; $x++) { echo "&lt;tr&gt;"; for ($y = 0; $y &lt; 10; $y++) { $alpha = array_splice($tarray,rand(0,count($tarray)-1),1); echo "&lt;td&gt;" . $count . $alpha[0] . "&lt;/td&gt;"; $count++; } echo "&lt;/tr&gt;"; } echo "&lt;/table&gt;"; } </code></pre> <p>could shorten this with completely random generated 2 letter strings but i particularly wanted to show use of array_splice() if you have an actual array of 100 (or 400?) 2 letter strings and wanted to do a "pick once" deal, where you randomly select it and can only use it on one cell. </p>