Repeating array... Thats not supposed to repeat?
<p>For some reason this array keeps repeating the 1st line onto the 2nd line and the 1st and 2nd line onto the 3rd line, and so on and so on.</p>

<pre><code>unset ($grade); $grade = array();
foreach ($row as $grade =&gt; $value) {
  if (substr($grade, 0,1)== "y") {
  if ($grade == "y1") {if ($value == "x") {$grades[] = "1";}}
  if ($grade == "y2") {if ($value == "x") {$grades[] = "2";}}
  if ($grade == "y3") {if ($value == "x") {$grades[] = "3";}}
  if ($grade == "y4") {if ($value == "x") {$grades[] = "4";}}
  if ($grade == "y5") {if ($value == "x") {$grades[] = "5";}}
  if ($grade == "y6") {if ($value == "x") {$grades[] = "6";}}
  if ($grade == "y7") {if ($value == "x") {$grades[] = "7";}}
}}
$grades_string = implode(", ", $grades);
</code></pre>

<p>The dB rows are titled y1, y2 etc.
 I can show someone a link with the example of what I mean the error is if need be. </p>
