title: Regexp for cleaning the empty, unnecessary HTML tags
body: <p>I'm using TinyMCE (WYSIWYG) as the default editor in one of my projects and sometimes it automatically adds <code>&lt;p&gt;&amp;nbsp;&lt;/p&gt; , &lt;p&gt; &lt;/p&gt;</code> or divs.</p>
  
  <p>I have been searching but I couldn't really find a good way of cleaning any empty tags with regex.</p>
  
  <p>The code I've tried to used is,</p>
  
  <pre><code>$pattern = "/&lt;[^\/&gt;]*&gt;([\s]?)*&lt;\/[^&gt;]*&gt;/";
  $str = preg_replace($pattern, '', $str); 
  </code></pre>
  
  <p>Note: I also want to clear &amp;nbsp too :(</p>