title: How do I replace tabs with spaces within variables in PHP?
body: <p><code>$data</code> contains tabs, leading spaces and multiple spaces. I wish to replace all tabs with a space. Multiple spaces with one single space, and remove leading spaces.</p>
  
  <p>In fact somthing that would turn this input data:</p>
  
  <pre><code>[    asdf asdf     asdf           asdf   ] 
  </code></pre>
  
  <p>Into output data:</p>
  
  <pre><code>[asdf asdf asdf asdf]
  </code></pre>
  
  <p>How do I do this?</p>