title: Asterisk pyramid using php while loop
body: <pre><code>$i=0; $j=5; $k=0;
  
  while($i &lt; 5 ) {
      while($j &gt; $i){
          echo " ";
          $j--;
      }
      while($k &lt;= $i){
          echo '*';
          ++$k;
      }       
  
      echo "&lt;br/&gt;";
      $i++;
  }
  </code></pre>
  
  <p>I am trying to creating asterisk pyramid using while loop with php, but the output as image enclosed. The asterisk character not show an pyramid. Instead of just single line:</p>
  
  <p><img src="https://i.stack.imgur.com/tLgQR.jpg" alt="output from above code"></p>
  
  <p>Please enlighten me the error of the code. </p>