title: Find all elements except for those with certain class with simple_html_dom.php
body: <p>I am using the <a href="http://simplehtmldom.sourceforge.net/" rel="nofollow">simple_html_dom parser</a> and I want to fetch data from html code that looks like this:</p>
  
  <pre><code>&lt;pre class="root"&gt;
       &lt;span class="B bgB"&gt;&lt;/span&gt;
       &lt;span class="B bgB"&gt;&lt;/span&gt;
       &lt;span class="B bgB"&gt;&lt;/span&gt;
       &lt;span class="B bgB"&gt;&lt;/span&gt;
       &lt;span class="W"&gt;&lt;/span&gt;
       &lt;span class="Y DH"&gt; &lt;/span&gt;
       &lt;span class="Y DH"&gt;Some text&lt;/span&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>etc.. </p>
  
  <p>But I only want to get the content from the ones <em>without</em> the bgB class. So far I have this code:</p>
  
  <pre><code>$elements = $html-&gt;find('pre.root span[class!=bgB]');
  </code></pre>
  
  <p>But all spans are fetched and later printed, not only the ones without the bgB class. How can I accomplish this?</p>