Escaping double quotes in php
<p>I have the following variable being dynamically set by user generated content:</p>

<pre><code>$variable = '&lt;a href="http://www.mysite.com/article"&gt;This Article&lt;/a&gt;';
</code></pre>

<p>When this variable is set, I then echo it as such</p>

<pre><code>echo $variable;
</code></pre>

<p>I know that as is, this wouldn't be valid because I would need to escape the double quotes etc.</p>

<p>Is there a way to automate the process to make the variable printable as a clickable link, thus escaping the quotes in my variable automatically?</p>

<p><hr></p>

<p>Edit:
Turns out this is indeed perfectly valid, but this being used on a joomla site, html tags are being stripped out, and I have to use [[a href]] instead of the regular &lt;>.
Thanks everyone for your help!</p>
