title: Format plain text values in columns using \t in php
body: <p>I have the following code in php, when i execute it:</p>
  
  <pre><code>&lt;pre&gt;
  &lt;?php
  $input = '&lt;xml&gt;
  &lt;user&gt;
      &lt;name&gt;sujit agarwal&lt;/name&gt;
      &lt;age&gt;22&lt;/age&gt;
      &lt;gender&gt;male&lt;/gender&gt;
  &lt;/user&gt;
  &lt;user&gt;
      &lt;name&gt;ajay rana&lt;/name&gt;
      &lt;age&gt;25&lt;/age&gt;
      &lt;gender&gt;male&lt;/gender&gt;
  &lt;/user&gt;
  &lt;user&gt;
      &lt;name&gt;pratap singh&lt;/name&gt;
      &lt;age&gt;27&lt;/age&gt;
      &lt;gender&gt;male&lt;/gender&gt;
  &lt;/user&gt;
  &lt;user&gt;
      &lt;name&gt;asdfasdfasdfasdf&lt;/name&gt;
      &lt;age&gt;30&lt;/age&gt;
      &lt;gender&gt;male&lt;/gender&gt;
  &lt;/user&gt;
  &lt;/xml&gt;';
  $sx = simplexml_load_string($input);
  foreach($sx as $val)
  echo $val-&gt;name."\t".$val-&gt;gender."\t".$val-&gt;age."\n";
  ?&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p><strong>THE OUTPUT IS</strong></p>
  
  <pre><code>sujit agarwal   male    22
  ajay rana   male    25
  pratap singh    male    27
  asdfasdfasdfasdf    male    30
  </code></pre>
  
  <p>now, my problem is how to align all the gender values and age values in a column even if a name is longer than the rest. Hope i made my problem clear. <strong>This is to be done within the PRE tags. because i will later save this to a TXT file</strong></p>
  
  <p><strong>NEEDED FORMATTING</strong></p>
  
  <pre><code>sujit agarwal       male    22
  ajay rana           male    25
  pratap singh        male    27
  asdfasdfasdfasdf    male    30
  </code></pre>