Extracting text from html?
<p>I have a string as below</p>

<pre><code>&lt;p&gt;&amp;nbsp;Hello World, this is StackOverflow&amp;#39;s question details page&lt;/p&gt;
</code></pre>

<p>I want to extract text from above HTML as <code>Hello World, this is StackOverflow's question details page</code> notice that I want to remove the <code>&amp;nbsp;</code> as well. </p>

<p>How we can achieve this in PHP, I tried few functions, strip_tags, html_entity_decode etc, but all are failing in some conditions.</p>

<p>Please help, Thanks!</p>

<p><strong>Edited</strong> my code which I am trying is as below, but its not working :( It leaves the <code>&amp;nbsp;</code> and <code>&amp;#39;</code> this type of characters.</p>

<pre><code>$TMP_DESCR = trim(strip_tags($rs['description']));
</code></pre>
