title: Triangle of asterisks in php
body: <p>I am having problems creating a triangle in php. This is my code. </p>
  
  <pre><code>for($i = 0; $i &lt;= $input; $i++) {
      for($j = 1; $j &lt;= $i; $j++) {
          echo " $char &amp;nbsp";
      }
      echo "&lt;br&gt;";
  }
  </code></pre>
  
  <p>The result is this.</p>
  
  <pre><code>*  
  *   *  
  *   *   *  
  *   *   *   *  
  *   *   *   *   *  
  </code></pre>
  
  <p>But what I'm trying to do is this.</p>
  
  <pre><code>                *  
              *   *  
          *   *   *  
      *   *   *   *  
  *   *   *   *   *  
  </code></pre>
  
  <p>What should I change with my codes?</p>