title: PHP nested while loop
body: <p>I tried to do a <code>while</code> inside a <code>while</code> to print a multiplication table like,</p>
  
  <pre class="lang-none prettyprint-override"><code>1  2  3  4  5
  2  4  6  8 10
  3  6  9 12 15
  4  8 12 16 20
  5 10 15 20 25
  </code></pre>
  
  <p>But I got only 1, 2, 3, 4, 5.</p>
  
  <h3>Code:</h3>
  
  <pre><code>$i = 1;
  $x = 1;
  while($i &lt;= 5){
     while($x &lt;= 5){
       echo $i * $x;
       $x++;
     }
     echo "&lt;br&gt;";
     $i++;
  }
  </code></pre>