Copied!
Abstract
Methods
public __call( $name, $arguments)
 
  • param string $name
  • param array $arguments
  • return bool|mixed
public abstract static __callStatic( $name, $arguments)
 
  • param string $name
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
public __clone()
public abstract __get( $name)
 
  • param string $name
  • return string|null
public abstract __toString() : string
 
  • return string
public clear() : bool
 

does nothing (only for api-compatibility-reasons)

  • return bool
  • deprecated
public abstract find(string $selector, $idx = NULL)
 

Find list of nodes with a CSS selector.

  • param string $selector
  • param int|null $idx
  • return mixed
public abstract findMulti(string $selector)
 

Find nodes with a CSS selector.

  • param string $selector
  • return mixed
public abstract findMultiOrFalse(string $selector)
 

Find nodes with a CSS selector or false, if no element is found.

  • param string $selector
  • return mixed
public abstract findOne(string $selector)
 

Find one node with a CSS selector.

  • param string $selector
  • return mixed
public abstract findOneOrFalse(string $selector)
 

Find one node with a CSS selector or false, if no element is found.

  • param string $selector
  • return mixed
public abstract voku\helper\DomParserInterface::fixHtmlOutput(string $content, bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true) : string
 
  • param string $content
  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public getDocument() : DOMDocument
 
  • return DOMDocument
public abstract voku\helper\DomParserInterface::getElementByClass(string $class)
 

Return elements by ".class".

  • param string $class
  • return mixed
public abstract voku\helper\DomParserInterface::getElementById(string $id)
 

Return element by #id.

  • param string $id
  • return mixed
public abstract voku\helper\DomParserInterface::getElementByTagName(string $name)
 

Return element by tag name.

  • param string $name
  • return mixed
public abstract voku\helper\DomParserInterface::getElementsById(string $id, $idx = NULL)
 

Returns elements by "#id".

  • param string $id
  • param int|null $idx
  • return mixed
public abstract voku\helper\DomParserInterface::getElementsByTagName(string $name, $idx = NULL)
 

Returns elements by tag name.

  • param string $name
  • param int|null $idx
  • return mixed
public abstract html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true) : string
 

Get dom node's outer html.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public innerXml(bool $multiDecodeNewHtmlEntity = false) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • return string
public abstract loadHtml(string $html, $libXMLExtraOptions = NULL) : voku\helper\DomParserInterface
 

Load HTML from string.

public abstract loadHtmlFile(string $filePath, $libXMLExtraOptions = NULL) : voku\helper\DomParserInterface
 

Load HTML from file.

public static putReplacedBackToPreserveHtmlEntities(string $html, bool $putBrokenReplacedBack = true) : string
 
  • param string $html
  • return string
public static replaceToPreserveHtmlEntities(string $html) : string
 
  • param string $html
  • return string
public save(string $filepath = '') : string
 

Save the html-dom as string.

  • param string $filepath
  • return string
public set_callback( $functionName)
 
  • param callable $functionName
  • phpstan-param callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void $functionName
  • return void
public text(bool $multiDecodeNewHtmlEntity = false) : string
 

Get dom node's plain text.

  • param bool $multiDecodeNewHtmlEntity
  • return string
public xml(bool $multiDecodeNewHtmlEntity = false, bool $htmlToXml = true, bool $removeXmlHeader = true, int $options = 4LIBXML_NOEMPTYTAG) : string
 

Get the HTML as XML or plain XML if needed.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $htmlToXml
  • param bool $removeXmlHeader
  • param int $options
  • return string
Properties
protected static $callback
 
  • var callable|null
  • phpstan-var null|callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void
protected $document
 
  • var DOMDocument
protected static $domBrokenReplaceHelper
 
  • var array
protected static $domHtmlBrokenHtmlHelper = '____simple_html_dom__voku__broken_html____'
 
  • var string
protected static $domHtmlSpecialScriptHelper = '____simple_html_dom__voku__html_special_script____'
 
  • var string
protected static $domHtmlWrapperHelper = '____simple_html_dom__voku__html_wrapper____'
 
  • var string
protected static $domLinkReplaceHelper = ['orig' => ['[', ']', '{', '}'], 'tmp' => ['____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_LEFT____', '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_RIGHT____', '____SIMPLE_HTML_DOM__VOKU__BRACKET_LEFT____', '____SIMPLE_HTML_DOM__VOKU__BRACKET_RIGHT____']]
 
  • var string[]
protected static $domReplaceHelper = ['orig' => ['&', '|', '+', '%', '@', '<html ⚡'], 'tmp' => ['____SIMPLE_HTML_DOM__VOKU__AMP____', '____SIMPLE_HTML_DOM__VOKU__PIPE____', '____SIMPLE_HTML_DOM__VOKU__PLUS____', '____SIMPLE_HTML_DOM__VOKU__PERCENT____', '____SIMPLE_HTML_DOM__VOKU__AT____', '<html ____SIMPLE_HTML_DOM__VOKU__GOOGLE_AMP____="true"']]
 
  • var string[]
protected $encoding
 
  • var string
protected static $functionAliases
 
  • var string[]
Methods
protected abstract createDOMDocument(string $html, $libXMLExtraOptions = NULL) : DOMDocument
 

Create DOMDocument from HTML.

  • param string $html
  • param int|null $libXMLExtraOptions
  • return DOMDocument
protected decodeHtmlEntity(string $content, bool $multiDecodeNewHtmlEntity) : string
 
  • param string $content
  • param bool $multiDecodeNewHtmlEntity
  • return string
protected getEncoding() : string
 

Get the encoding to use.

  • return string
protected html5FallbackForScriptTags(string $html)
 
  • param string $html
  • return void
Properties
protected static $callback
 
  • var callable|null
  • phpstan-var null|callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void
protected static $domBrokenReplaceHelper
 
  • var array
protected static $domHtmlBrokenHtmlHelper = '____simple_html_dom__voku__broken_html____'
 
  • var string
protected static $domHtmlSpecialScriptHelper = '____simple_html_dom__voku__html_special_script____'
 
  • var string
protected static $domHtmlWrapperHelper = '____simple_html_dom__voku__html_wrapper____'
 
  • var string
protected static $domLinkReplaceHelper = ['orig' => ['[', ']', '{', '}'], 'tmp' => ['____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_LEFT____', '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_RIGHT____', '____SIMPLE_HTML_DOM__VOKU__BRACKET_LEFT____', '____SIMPLE_HTML_DOM__VOKU__BRACKET_RIGHT____']]
 
  • var string[]
protected static $domReplaceHelper = ['orig' => ['&', '|', '+', '%', '@', '<html ⚡'], 'tmp' => ['____SIMPLE_HTML_DOM__VOKU__AMP____', '____SIMPLE_HTML_DOM__VOKU__PIPE____', '____SIMPLE_HTML_DOM__VOKU__PLUS____', '____SIMPLE_HTML_DOM__VOKU__PERCENT____', '____SIMPLE_HTML_DOM__VOKU__AT____', '<html ____SIMPLE_HTML_DOM__VOKU__GOOGLE_AMP____="true"']]
 
  • var string[]
protected static $functionAliases
 
  • var string[]
Methods
public abstract static __callStatic( $name, $arguments)
 
  • param string $name
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
public static putReplacedBackToPreserveHtmlEntities(string $html, bool $putBrokenReplacedBack = true) : string
 
  • param string $html
  • return string
public static replaceToPreserveHtmlEntities(string $html) : string
 
  • param string $html
  • return string
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration