How to print the following with php[preferred] or javaScript? : <p>So i was asked the following question in an interview. I was able to print the whole xxx thing. but it was not diagonal like the below one. I think it meant to have spaces prints through a loop. Can Someone please help me with this.</p>

<p>How to print the following using php or javascript?? Php would be preferred.</p>

<pre><code>     xx
    xxxx
   xxxxxx
  xxxxxxxx
 xxxxxxxxxx
</code></pre>

<p>what i was able to get was</p>

<pre><code>xx
xxxx
xxxxxx
xxxxxxxx
xxxxxxxxxx 
</code></pre>

<p>through php for loop.</p>
