PHP for loop 'map' background color
<p>I've got a simple code that generates a 'map' or grid. im trying to define certain areas, in this example if the value for <code>$i</code> or <code>$j</code> is 1 then this defines the edge of my 'map' so I'm trying to set the class of that cell to 'edge' which is just a background color of grey for now.</p>

<pre><code>echo "&lt;tr&gt;";

    for ($j=1; $j &lt;= 50; $j++)

        {
        // edge of map - this is where i have a  problem
        if($i == '1' or $j == '1'){$st = 'class="edge"';}   

         echo "&lt;td $st id = \"$i-$j\"&gt;";
         echo "$i-$j";
         echo "&lt;/td&gt;";



        }

    echo "&lt;/tr&gt;";
</code></pre>

<p>the problem is it turns all of the cells grey rather than just the cells which have a value of 1. I'm probably doing something stupid.</p>