Trim &nbsp; with php
<p>I have a sentence like this.</p>

<pre><code>1 $nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; 4
</code></pre>

<p>As you see, in between 1 2 and 3 text, there are extra spaces. I want the output with only one space between them. so my output will be 1 2 3 4 </p>

<p>How can i use php trim to get the output like this. If i use trim, it can only remove whitespace, but not that &nbsp;</p>

<p>Thanks.</p>
