pQuery\DomNode::getPreviousSibling PHP Метод

getPreviousSibling() публичный Метод

Get node previous to current
См. также: getSibling()
См. также: getNextSibling()
public getPreviousSibling ( boolean $skip_text_comments = true ) : DomNode
$skip_text_comments boolean
Результат DomNode Null if not found
    function getPreviousSibling($skip_text_comments = true)
    {
        $offset = -1;
        while (($n = $this->getSibling($offset)) !== null) {
            if ($skip_text_comments && $n->tag[0] === '~') {
                --$offset;
            } else {
                break;
            }
        }
        return $n;
    }
DomNode