echo a string, replacing nl with br and horizontal tabs with some html char
<p>For debugging I want to echo or print my MySQL with html replacements for the nl and horizontal tabs.</p>

<pre><code>$sql="
SELECT
    *
FROM
    `mytable`;";
</code></pre>

<p>I can do <code>echo nl2br($sql);</code> in order to replace <code>\n</code> with <code>&lt;br /&gt;</code>. This gives me the screen output:</p>

<pre><code>SELECT
*
FROM
`mytable`;
</code></pre>

<p>Now I want to swap the horizontal tabs for something like <code>&amp;nbsp;</code> in order to indent them on the screen.</p>

<p>What could I use instead of <code>&amp;nbsp;</code>, I've never liked it?</p>

<p>Thanks</p>
