Recommend this page to a friend! |
Classes of Lars Moelleken | Simple HTML DOM | README_API.md | Download |
|
Download [//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/api.md) :scroll: Simple Html Dom Parser for PHPDomParser API<p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#findstring-selector-intnull-idx-mixed">find</a> </td><td><a href="#findmultistring-selector-mixed">findMulti</a> </td><td><a href="#findmultiorfalsestring-selector-mixed">findMultiOrFalse</a> </td><td><a href="#findonestring-selector-static">findOne</a> </td></tr><tr><td><a href="#findoneorfalsestring-selector-mixed">findOneOrFalse</a> </td><td><a href="#fixhtmloutputstring-content-bool-multidecodenewhtmlentity-string">fixHtmlOutput</a> </td><td><a href="#getdocument-domdocument">getDocument</a> </td><td><a href="#getelementbyclassstring-class-mixed">getElementByClass</a> </td></tr><tr><td><a href="#getelementbyidstring-id-mixed">getElementById</a> </td><td><a href="#getelementbytagnamestring-name-mixed">getElementByTagName</a> </td><td><a href="#getelementsbyidstring-id-intnull-idx-mixed">getElementsById</a> </td><td><a href="#getelementsbytagnamestring-name-intnull-idx-mixed">getElementsByTagName</a> </td></tr><tr><td><a href="#htmlbool-multidecodenewhtmlentity-string">html</a> </td><td><a href="#innerhtmlbool-multidecodenewhtmlentity-string">innerHtml</a> </td><td><a href="#innerxmlbool-multidecodenewhtmlentity-string">innerXml</a> </td><td><a href="#loadhtmlstring-html-intnull-libxmlextraoptions-domparserinterface">loadHtml</a> </td></tr><tr><td><a href="#loadhtmlfilestring-filepath-intnull-libxmlextraoptions-domparserinterface">loadHtmlFile</a> </td><td><a href="#savestring-filepath-string">save</a> </td><td><a href="#set_callbackcallable-functionname-mixed">set_callback</a> </td><td><a href="#textbool-multidecodenewhtmlentity-string">text</a> </td></tr><tr><td><a href="#xmlbool-multidecodenewhtmlentity-bool-htmltoxml-bool-removexmlheader-int-options-string">xml</a> </td></tr></table> SimpleHtmlDomNode (group of dom elements) API<p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#count-int">count</a> </td><td><a href="#findstring-selector-int-idx-simplehtmldomnodesimplehtmldomnodenull">find</a> </td><td><a href="#findmultistring-selector-simplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMulti</a> </td><td><a href="#findmultiorfalsestring-selector-falsesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMultiOrFalse</a> </td></tr><tr><td><a href="#findonestring-selector-simplehtmldomnodenull">findOne</a> </td><td><a href="#findoneorfalsestring-selector-falsesimplehtmldomnode">findOneOrFalse</a> </td><td><a href="#innerhtml-string">innerHtml</a> </td><td><a href="#innertext-string">innertext</a> </td></tr><tr><td><a href="#outertext-string">outertext</a> </td><td><a href="#text-string">text</a> </td></tr></table> SimpleHtmlDom (single dom element) API<p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#childnodesint-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacenull">childNodes</a> </td><td><a href="#delete-mixed">delete</a> </td><td><a href="#findstring-selector-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">find</a> </td><td><a href="#findmultistring-selector-simplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMulti</a> </td></tr><tr><td><a href="#findmultiorfalsestring-selector-falsesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">findMultiOrFalse</a> </td><td><a href="#findonestring-selector-simplehtmldominterface">findOne</a> </td><td><a href="#findoneorfalsestring-selector-falsesimplehtmldominterface">findOneOrFalse</a> </td><td><a href="#firstchild-simplehtmldominterfacenull">firstChild</a> </td></tr><tr><td><a href="#getallattributes-stringnull">getAllAttributes</a> </td><td><a href="#getattributestring-name-string">getAttribute</a> </td><td><a href="#getelementbyclassstring-class-simplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementByClass</a> </td><td><a href="#getelementbyidstring-id-simplehtmldominterface">getElementById</a> </td></tr><tr><td><a href="#getelementbytagnamestring-name-simplehtmldominterface">getElementByTagName</a> </td><td><a href="#getelementsbyidstring-id-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementsById</a> </td><td><a href="#getelementsbytagnamestring-name-intnull-idx-simplehtmldominterfacesimplehtmldominterfacesimplehtmldomnodeinterfacesimplehtmldominterface">getElementsByTagName</a> </td><td><a href="#gethtmldomparser-htmldomparser">getHtmlDomParser</a> </td></tr><tr><td><a href="#getiterator-simplehtmldomnodeinterfacesimplehtmldominterface">getIterator</a> </td><td><a href="#getnode-domnode">getNode</a> </td><td><a href="#gettag-string">getTag</a> </td><td><a href="#hasattributestring-name-bool">hasAttribute</a> </td></tr><tr><td><a href="#htmlbool-multidecodenewhtmlentity-string">html</a> </td><td><a href="#innerhtmlbool-multidecodenewhtmlentity-string">innerHtml</a> </td><td><a href="#innerxmlbool-multidecodenewhtmlentity-string">innerXml</a> </td><td><a href="#isremoved-bool">isRemoved</a> </td></tr><tr><td><a href="#lastchild-simplehtmldominterfacenull">lastChild</a> </td><td><a href="#nextnonwhitespacesibling-simplehtmldominterfacenull">nextNonWhitespaceSibling</a> </td><td><a href="#nextsibling-simplehtmldominterfacenull">nextSibling</a> </td><td><a href="#parentnode-simplehtmldominterface">parentNode</a> </td></tr><tr><td><a href="#previousnonwhitespacesibling-simplehtmldominterfacenull">previousNonWhitespaceSibling</a> </td><td><a href="#previoussibling-simplehtmldominterfacenull">previousSibling</a> </td><td><a href="#removeattributestring-name-simplehtmldominterface">removeAttribute</a> </td><td><a href="#removeattributes-simplehtmldominterface">removeAttributes</a> </td></tr><tr><td><a href="#setattributestring-name-stringnull-value-bool-strictemptyvaluecheck-simplehtmldominterface">setAttribute</a> </td><td><a href="#text-string">text</a> </td><td><a href="#valstringstringnull-value-stringstringnull">val</a> </td></tr></table> find(string $selector, int|null $idx): mixed<a href="#voku-php-readme-class-methods">?</a> Find list of nodes with a CSS selector. Parameters:
- Return:
- findMulti(string $selector): mixed<a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector. Parameters:
- Return:
- findMultiOrFalse(string $selector): mixed<a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector or false, if no element is found. Parameters:
- Return:
- findOne(string $selector): static<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector. Parameters:
- Return:
- findOneOrFalse(string $selector): mixed<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector or false, if no element is found. Parameters:
- Return:
- fixHtmlOutput(string $content, bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Parameters:
- Return:
- getDocument(): DOMDocument<a href="#voku-php-readme-class-methods">?</a> Parameters: __nothing__ Return:
- getElementByClass(string $class): mixed<a href="#voku-php-readme-class-methods">?</a> Return elements by ".class". Parameters:
- Return:
- getElementById(string $id): mixed<a href="#voku-php-readme-class-methods">?</a> Return element by #id. Parameters:
- Return:
- getElementByTagName(string $name): mixed<a href="#voku-php-readme-class-methods">?</a> Return element by tag name. Parameters:
- Return:
- getElementsById(string $id, int|null $idx): mixed<a href="#voku-php-readme-class-methods">?</a> Returns elements by "#id". Parameters:
- Return:
- getElementsByTagName(string $name, int|null $idx): mixed<a href="#voku-php-readme-class-methods">?</a> Returns elements by tag name. Parameters:
- Return:
- html(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's outer html. Parameters:
- Return:
- innerHtml(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's inner html. Parameters:
- Return:
- innerXml(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's inner xml. Parameters:
- Return:
- loadHtml(string $html, int|null $libXMLExtraOptions): DomParserInterface<a href="#voku-php-readme-class-methods">?</a> Load HTML from string. Parameters:
- Return:
- loadHtmlFile(string $filePath, int|null $libXMLExtraOptions): DomParserInterface<a href="#voku-php-readme-class-methods">?</a> Load HTML from file. Parameters:
- Return:
- save(string $filepath): string<a href="#voku-php-readme-class-methods">?</a> Save the html-dom as string. Parameters:
- Return:
- set_callback(callable $functionName): mixed<a href="#voku-php-readme-class-methods">?</a> Parameters:
- Return:
- text(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's plain text. Parameters:
- Return:
- xml(bool $multiDecodeNewHtmlEntity, bool $htmlToXml, bool $removeXmlHeader, int $options): string<a href="#voku-php-readme-class-methods">?</a> Get the HTML as XML or plain XML if needed. Parameters:
- Return:
- count(): int<a href="#voku-php-readme-class-methods">?</a> Get the number of items in this dom node. Parameters: __nothing__ Return:
- find(string $selector, int $idx): SimpleHtmlDomNode|\SimpleHtmlDomNode[]|null<a href="#voku-php-readme-class-methods">?</a> Find list of nodes with a CSS selector. Parameters:
- Return:
- findMulti(string $selector): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector. Parameters:
- Return:
- findMultiOrFalse(string $selector): false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector or false, if no element is found. Parameters:
- Return:
- findOne(string $selector): SimpleHtmlDomNode|null<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector. Parameters:
- Return:
- findOneOrFalse(string $selector): false|\SimpleHtmlDomNode<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector or false, if no element is found. Parameters:
- Return:
- innerHtml(): string[]<a href="#voku-php-readme-class-methods">?</a> Get html of elements. Parameters: __nothing__ Return:
- innertext(): string[]<a href="#voku-php-readme-class-methods">?</a> alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) Parameters: __nothing__ Return:
- outertext(): string[]<a href="#voku-php-readme-class-methods">?</a> alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) Parameters: __nothing__ Return:
- text(): string[]<a href="#voku-php-readme-class-methods">?</a> Get plain text. Parameters: __nothing__ Return:
- childNodes(int $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns children of node. Parameters:
- Return:
- delete(): mixed<a href="#voku-php-readme-class-methods">?</a> Delete Parameters: __nothing__ Return:
- find(string $selector, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Find list of nodes with a CSS selector. Parameters:
- Return:
- findMulti(string $selector): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector. Parameters:
- Return:
- findMultiOrFalse(string $selector): false|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Find nodes with a CSS selector or false, if no element is found. Parameters:
- Return:
- findOne(string $selector): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector. Parameters:
- Return:
- findOneOrFalse(string $selector): false|\SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Find one node with a CSS selector or false, if no element is found. Parameters:
- Return:
- firstChild(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the first child of node. Parameters: __nothing__ Return:
- getAllAttributes(): string[]|null<a href="#voku-php-readme-class-methods">?</a> Returns an array of attributes. Parameters: __nothing__ Return:
- getAttribute(string $name): string<a href="#voku-php-readme-class-methods">?</a> Return attribute value. Parameters:
- Return:
- getElementByClass(string $class): SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Return elements by ".class". Parameters:
- Return:
- getElementById(string $id): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Return element by "#id". Parameters:
- Return:
- getElementByTagName(string $name): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Return element by tag name. Parameters:
- Return:
- getElementsById(string $id, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Returns elements by "#id". Parameters:
- Return:
- getElementsByTagName(string $name, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Returns elements by tag name. Parameters:
- Return:
- getHtmlDomParser(): HtmlDomParser<a href="#voku-php-readme-class-methods">?</a> Create a new "HtmlDomParser"-object from the current context. Parameters: __nothing__ Return:
- getIterator(): SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface><a href="#voku-php-readme-class-methods">?</a> Retrieve an external iterator. Parameters: __nothing__ Return: - `\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface> <p> An instance of an object implementing <b>Iterator</b> or <b>Traversable</b> </p>` getNode(): DOMNode<a href="#voku-php-readme-class-methods">?</a> Parameters: __nothing__ Return:
- getTag(): string<a href="#voku-php-readme-class-methods">?</a> Return the tag of node Parameters: __nothing__ Return:
- hasAttribute(string $name): bool<a href="#voku-php-readme-class-methods">?</a> Determine if an attribute exists on the element. Parameters:
- Return:
- html(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's outer html. Parameters:
- Return:
- innerHtml(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's inner html. Parameters:
- Return:
- innerXml(bool $multiDecodeNewHtmlEntity): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's inner html. Parameters:
- Return:
- isRemoved(): bool<a href="#voku-php-readme-class-methods">?</a>
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 Parameters: __nothing__ Return:
- lastChild(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the last child of node. Parameters: __nothing__ Return:
- nextNonWhitespaceSibling(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the next sibling of node, and it will ignore whitespace elements. Parameters: __nothing__ Return:
- nextSibling(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the next sibling of node. Parameters: __nothing__ Return:
- parentNode(): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Returns the parent of node. Parameters: __nothing__ Return:
- previousNonWhitespaceSibling(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the previous sibling of node, and it will ignore whitespace elements. Parameters: __nothing__ Return:
- previousSibling(): SimpleHtmlDomInterface|null<a href="#voku-php-readme-class-methods">?</a> Returns the previous sibling of node. Parameters: __nothing__ Return:
- removeAttribute(string $name): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Remove attribute. Parameters:
- Return:
- removeAttributes(): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Remove all attributes Parameters: __nothing__ Return:
- setAttribute(string $name, string|null $value, bool $strictEmptyValueCheck): SimpleHtmlDomInterface<a href="#voku-php-readme-class-methods">?</a> Set attribute value. Parameters:
- Return:
- text(): string<a href="#voku-php-readme-class-methods">?</a> Get dom node's plain text. Parameters: __nothing__ Return:
- val(string|string[]|null $value): string|string[]|null<a href="#voku-php-readme-class-methods">?</a> Parameters: - `string|string[]|null $value <p> null === get the current input value text === set a new input value </p>` Return:
- |