Extract link attributes from string of HTML
<p>What's the best way to extract HTML out of $var?</p>

<p>example of $var</p>

<pre><code>$var = "&lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;"
</code></pre>

<p>I want </p>

<pre><code>$var2 = "http://stackoverflow.com/"
</code></pre>

<p>example: preg_match();</p>

<p>what else?</p>
