私はこのHTMLを持っています:
<div class="hello top">some content</div>
<div class="hello top">some content</div>
<div class="hello">some content</div>
<div class="hello">some content</div>
<div class="hello">some content</div>
...そして、クラス「hello」を持ち、クラス「top」を持たないDIVのみを取得しようとしています(最後の3つのDIVのみを取得したい)。
私はこのようなことを試みましたが、成功しませんでした:
foreach( $html->find('div[class="hello"], div[class!="top"]') as $element ) {
// some code...
}