Spaces doesn't come after nl2br(htmlentities($text))?
<p>I am printing a article with spaces inside the article.
Text inside article has HTML tags also,so i am using htmlentities before echo.</p>

<p>But problem is that display does't show spaces on the browser.
What is the problem with these commands?</p>

<p>Can someone please suggest me a better option?</p>

<p>DB update command:</p>

<pre><code> mysql_real_escape_string($text, $db)
</code></pre>

<p>Article display command:</p>

<pre><code>echo nl2br(htmlentities($row_page['text']));
</code></pre>

<p>Example: displayed text is pretty ugly   </p>

<p>Real text and i am expecting same:</p>

<pre><code>dbus-1/                   libcom_err.so.2@                     libglib-2.0.so.0@            liblvm2cmd.so.2.02*      libpopt.so.0.0.0*
device-mapper/            libcom_err.so.2.1*                   libglib-2.0.so.0.2200.5*     libm-2.12.so*            libproc-3.2.8.so*
firmware/                 libcrypt-2.12.so*                    libgmodule-2.0.so.0@   
</code></pre>
