Selector
class Selector (View source)
Methods
__construct(DOMDocument $document, bool $registerNodeNS = true)
Create a Inphinit\Dom\Selector instance.
int|false
count(string $selector)
Count all nodes matching the given CSS selector. If the selector is not valid, it will return false.
all(string $selector)
Returns a \DOMNodeList that match the specified selector
first(string $selector)
Returns the first element or node within the document that matches the specified selector.
Details
__construct(DOMDocument $document, bool $registerNodeNS = true)
Create a Inphinit\Dom\Selector instance.
DOMXPath
xpath()
Get DOMXPath instance
int|false
count(string $selector)
Count all nodes matching the given CSS selector. If the selector is not valid, it will return false.
DOMNodeList
all(string $selector)
Returns a \DOMNodeList that match the specified selector
DOMElement|DOMNode|DOMNameSpaceNode|null
first(string $selector)
Returns the first element or node within the document that matches the specified selector.
If no matches are found, null is returned.