how to user nl2br function with htmlspecialchars in phpmysql
<p>can you please tell me how to insert nl2br function with htmlspecialchars.I have a site where input is taken from textarea and nl2br is used to convert next line to a paragraph. when i tried with htmlspecialchars i got the below output .here i wrote three 'test' words in textarea and saved in database.  I am using htmlspecialchars to prevent html injections but because of this function nl2br fuction is not working.can you tell be how to workaround this problem</p>

<pre><code>       test&lt;br/&gt;test&lt;br/&gt;test&lt;br/&gt;
</code></pre>
