two for loops in php
<p>I got this code...it's used two loops for.., can u explain how it's work ? the result is 16</p>

<pre><code>for($i=1; $i&lt;=2; $i++)
    {
       for($j=1; $i&lt;=5; $i++)
       {
          if($i == 1)
             echo $j;
          elseif($i ==2)
             echo $j+5;
       }
    } 
</code></pre>

<p>but if I make like this</p>

<pre><code>for($i=1; $i&lt;=2; $i++)
        {
           for($j=1; $i&lt;=5; $i++)
           {
              if($i == 1)
                 echo $j;
              elseif($i ==2)
                 echo $j;
           }
        } 
</code></pre>

<p>the result is 11.</p>

<p>how can be ?</p>
