count | find | findMulti | findMultiOrFalse |
findOne | findOneOrFalse | innerHtml | innertext |
outertext | text |
β Find list of nodes with a CSS selector.
Parameters:
string $selector
int|null $idx
Return:
mixed
β Find nodes with a CSS selector.
Parameters:
string $selector
Return:
mixed
β Find nodes with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
mixed
β Find one node with a CSS selector.
Parameters:
string $selector
Return:
static
β Find one node with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
mixed
Parameters:
string $content
bool $multiDecodeNewHtmlEntity
Return:
string
Parameters: nothing
Return:
\DOMDocument
β Return elements by ".class".
Parameters:
string $class
Return:
mixed
β Return element by #id.
Parameters:
string $id
Return:
mixed
β Return element by tag name.
Parameters:
string $name
Return:
mixed
β Returns elements by "#id".
Parameters:
string $id
int|null $idx
Return:
mixed
β Returns elements by tag name.
Parameters:
string $name
int|null $idx
Return:
mixed
β Get dom node's outer html.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Get dom node's inner html.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Get dom node's inner xml.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Load HTML from string.
Parameters:
string $html
int|null $libXMLExtraOptions
Return:
\DomParserInterface
β Load HTML from file.
Parameters:
string $filePath
int|null $libXMLExtraOptions
Return:
\DomParserInterface
β Save the html-dom as string.
Parameters:
string $filepath
Return:
string
Parameters:
callable $functionName
Return:
mixed
β Get dom node's plain text.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Get the HTML as XML or plain XML if needed.
Parameters:
bool $multiDecodeNewHtmlEntity
bool $htmlToXml
bool $removeXmlHeader
int $options
Return:
string
β Get the number of items in this dom node.
Parameters: nothing
Return:
int
β Find list of nodes with a CSS selector.
Parameters:
string $selector
int $idx
Return:
\SimpleHtmlDomNode|\SimpleHtmlDomNode[]|null
findMulti(string $selector): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find nodes with a CSS selector.
Parameters:
string $selector
Return:
\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
findMultiOrFalse(string $selector): false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find nodes with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find one node with a CSS selector.
Parameters:
string $selector
Return:
\SimpleHtmlDomNode|null
β Find one node with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
false|\SimpleHtmlDomNode
β Get html of elements.
Parameters: nothing
Return:
string[]
β alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x)
Parameters: nothing
Return:
string[]
β alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x)
Parameters: nothing
Return:
string[]
β Get plain text.
Parameters: nothing
Return:
string[]
childNodes(int $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface|null
β Returns children of node.
Parameters:
int $idx
Return:
\SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface|null
β Delete
Parameters: nothing
Return:
mixed
find(string $selector, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find list of nodes with a CSS selector.
Parameters:
string $selector
int|null $idx
Return:
\SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
findMulti(string $selector): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find nodes with a CSS selector.
Parameters:
string $selector
Return:
\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
findMultiOrFalse(string $selector): false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find nodes with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Find one node with a CSS selector.
Parameters:
string $selector
Return:
\SimpleHtmlDomInterface
β Find one node with a CSS selector or false, if no element is found.
Parameters:
string $selector
Return:
false|\SimpleHtmlDomInterface
β Returns the first child of node.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Returns an array of attributes.
Parameters: nothing
Return:
string[]|null
β Return attribute value.
Parameters:
string $name
Return:
string
getElementByClass(string $class): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Return elements by ".class".
Parameters:
string $class
Return:
\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Return element by "#id".
Parameters:
string $id
Return:
\SimpleHtmlDomInterface
β Return element by tag name.
Parameters:
string $name
Return:
\SimpleHtmlDomInterface
getElementsById(string $id, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Returns elements by "#id".
Parameters:
string $id
int|null $idx
Return:
\SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
getElementsByTagName(string $name, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Returns elements by tag name.
Parameters:
string $name
int|null $idx
Return:
\SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
β Create a new "HtmlDomParser"-object from the current context.
Parameters: nothing
Return:
\HtmlDomParser
β Retrieve an external iterator.
Parameters: nothing
Return:
- `\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface>
An instance of an object implementing Iterator or Traversable
Parameters: nothing
Return:
\DOMNode
β Return the tag of node
Parameters: nothing
Return:
string
β Determine if an attribute exists on the element.
Parameters:
string $name
Return:
bool
β Get dom node's outer html.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Get dom node's inner html.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β Get dom node's inner html.
Parameters:
bool $multiDecodeNewHtmlEntity
Return:
string
β
Nodes can get partially destroyed in which they're still an
actual DOM node (such as \DOMElement) but almost their entire
body is gone, including the nodeType
attribute.
Parameters: nothing
Return:
bool true if node has been destroyed
β Returns the last child of node.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Returns the next sibling of node, and it will ignore whitespace elements.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Returns the next sibling of node.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Returns the parent of node.
Parameters: nothing
Return:
\SimpleHtmlDomInterface
β Returns the previous sibling of node, and it will ignore whitespace elements.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Returns the previous sibling of node.
Parameters: nothing
Return:
\SimpleHtmlDomInterface|null
β Remove attribute.
Parameters:
string $name <p>The name of the html-attribute.</p>
Return:
\SimpleHtmlDomInterface
β Remove all attributes
Parameters: nothing
Return:
\SimpleHtmlDomInterface
β Set attribute value.
Parameters:
string $name <p>The name of the html-attribute.</p>
string|null $value <p>Set to NULL or empty string, to remove the attribute.</p>
- `bool $strictEmptyValueCheck $value must be NULL, to remove the attribute, so that you can set an empty string as attribute-value e.g. autofocus=""
Return:
\SimpleHtmlDomInterface
β Get dom node's plain text.
Parameters: nothing
Return:
string
Parameters:
- `string|string[]|null $value
null === get the current input value text === set a new input value
Return:
string|string[]|null