<?php $html = <<<HTML <h2>Title of post</h2> 1 category <strong>task 1</strong> 1 category <strong>task 2</strong> 1 category <strong>task 3</strong> HTML; $dom=new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->query('//h2/following-sibling::text()') as $node) { var_export(trim($node->textContent)); echo "\n"; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`