ok
HTML; $html = str_get_html($str); echo $html->find('div div div', 0)->innertext . '
'; // result: "ok" // ----------------------------------------------------------------------------- // nested selector $str = <<
  • item:1
  • item:2
  • HTML; $html = str_get_html($str); foreach($html->find('ul') as $ul) { foreach($ul->find('li') as $li) echo $li->innertext . '
    '; } // ----------------------------------------------------------------------------- // parsing checkbox $str = << item1
    item2
    item3
    HTML; $html = str_get_html($str); foreach($html->find('input[type=checkbox]') as $checkbox) { if ($checkbox->checked) echo $checkbox->name . ' is checked
    '; else echo $checkbox->name . ' is not checked
    '; } ?>