title: Trim &nbsp; with PHP
body: <p>I have a sentence like this.</p>
  
  <pre><code>1 &amp;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 <code>1 2 3 4</code>.</p>
  
  <p>If I use trim, it can only remove white space, but not that <code>&amp;nbsp;</code> How can I use PHP trim function to get the output like this? </p>