title: DOM: with PHP, how to figure out if a node is the last child of it's parent
body: <p>I'm trying to figure out how to know if a node is the last child of another, or not.</p>
  
  <p>I know how to retrieve the parent's <code>lastChild</code> name (<code>$node-&gt;parentNode-&gt;lastChild-&gt;nodeName</code>), but as sometimes there's many same node names within the same parent, the name is definitly not the way to find the last child.</p>
  
  <p>I'm looking for some kind of iterator which can retrieve the number of childs, and depending of the position of the current node, tell if the current node is the last child.</p>
  
  <p>Thanks!</p>