title: Keep white space with htmlentities
body: <p>Currently, this is my code</p>
  
  <pre><code>$str = file_get_contents($sFile);
  echo nl2br(htmlentities($str));
  </code></pre>
  
  <p>How can I keep the whitespace (tab and multiple spaces) in the files when i output them?</p>
  
  <p>Example Input:</p>
  
  <pre><code>if(a==b){
    code   
      more code 
  }
  </code></pre>
  
  <p>Should ouput exactly that (with htmlentities applied), but currently outputs</p>
  
  <pre><code>if(a==b){
  code
  more code
  }
  </code></pre>
  
  <p>How can I keep whitespace?</p>