protected function lastTagName($node)
    {
        $lastNode = $node->previousSibling;
        while ($lastNode != null) {
            if ($lastNode instanceof DOMElement) {
                break;
            }
            $lastNode = $lastNode->previousSibling;
        }
        $lastTag = '';
        if ($lastNode instanceof DOMElement && $lastNode != null) {
            $lastTag = strtolower($lastNode->nodeName);
        }

        return $lastTag;
    }
protected function lastTagName($node)
    {
        $lastNode = $node->previousSibling;
        while ($lastNode != null) {
            if ($lastNode instanceof DOMElement) {
                break;
            }
            $lastNode = $lastNode->previousSibling;
        }
        $lastTag = '';
        if ($lastNode instanceof DOMElement && $lastNode != null) {
            $lastTag = strtolower($lastNode->nodeName);
        }

        return $lastTag;
    }
protected function lastTagName ( $ node ) { $ lastNode = $ node -> previousSibling ; while ( $ lastNode != null ) { if ( $ lastNode instanceof DOMElement ) { break ; } $ lastNode = $ lastNode -> previousSibling ; } $ lastTag = '' ; if ( $ lastNode instanceof DOMElement && $ lastNode != null ) { $ lastTag = strtolower ( $ lastNode -> nodeName ) ; } return $ lastTag ; }
Find the previous sibling tag name for this node

@param  DOMNode $node DOM node
@return string        tag name
Find the previous sibling tag name for this node