pQuery\DomNode::getSibling PHP Method

getSibling() public method

Get sibling node
public getSibling ( integer $offset = 1 ) : DomNode
$offset integer Offset from current node
return DomNode Null if not found
    function getSibling($offset = 1)
    {
        $index = $this->index() + $offset;
        if ($index >= 0 && $index < $this->parent->childCount()) {
            return $this->parent->getChild($index);
        } else {
            return null;
        }
    }
DomNode