htmlspecialchars text
<p>I have created an article comment for my user to post comment. I also have a function that automatically creates link if url is detected in the message. However now I am puzzled as to how do I convert text using htmlspecialchars and at the same time creates the link together without "authoring the URL"?</p>

<p>For example: </p>

<pre><code>$message = 'This is a message with a url http://www.stackoverflow.com?id=1&amp;get=1';
makeLink( htmlspecialchars( $message ) )

// I will get "This is a message with a url http://www.stackoverflow.com?id=1&amp;amp;get=1" 
// Notice the ampersand became &amp;amp; How do I prevent this?
</code></pre>
