title: How can I print integer in triangle form
body: <p>I want to print integer in triangle form which look like this</p>
  
  <pre><code>    1
     121
    12321
  </code></pre>
  
  <p>I tried this but I do not get the actual result</p>
  
  <pre><code>for($i=1;$i&lt;=3;$i++)
   {
      for($j=3;$j&gt;=$i;$j--)
      {
        echo "&amp;nbsp;&amp;nbsp;";
      }
     for($k=1;$k&lt;=$i;$k++)
      {
        echo $k;
      }
     if($i&gt;1)
      {
        for($m=$i; $m&gt;=1; $m--)
           {
             echo $m;
           }
       }      
      echo "&lt;br&gt;";
  }
  </code></pre>
  
  <p>Output of this code is:</p>
  
  <pre><code>   1
    1221
   123321
  </code></pre>
  
  <p>Where am I going wrong, please guide me.</p>