snipt

Ctrl+h for KB shortcuts
#1206

PHP

select all nodes with no children

$nodesWithoutChildren = $xpath->query('*[not(*)]');
https://snipt.net/embed/5f10d8cd312a925702ccdc6cd6fbe8c5/
https://snipt.net/raw/5f10d8cd312a925702ccdc6cd6fbe8c5/
5f10d8cd312a925702ccdc6cd6fbe8c5
php
PHP
1
2014-04-16T00:30:44
True
False
/api/public/snipt/1206/
select-all-nodes-with-no-children
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="x">$nodesWithoutChildren = $xpath-&gt;query(&#39;*[not(*)]&#39;);</span> </span></pre></div> </td></tr></table>
children, node, xpath