You are here

public function HTML5::loadHTML in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/src/HTML5.php \Masterminds\HTML5::loadHTML()

Parse a HTML Document from a string.

Take a string of HTML 5 (or earlier) and parse it into a DOMDocument.

Parameters

string $string: A html5 document as a string.

array $options: Configuration options when parsing the HTML

Return value

\DOMDocument A DOM document. DOM is part of libxml, which is included with almost all distribtions of PHP.

1 call to HTML5::loadHTML()
HTML5::load in vendor/masterminds/html5/src/HTML5.php
Load and parse an HTML file.

File

vendor/masterminds/html5/src/HTML5.php, line 94

Class

HTML5
This class offers convenience methods for parsing and serializing HTML5. It is roughly designed to mirror the \DOMDocument class that is provided with most versions of PHP.

Namespace

Masterminds

Code

public function loadHTML($string, array $options = array()) {
  $input = new StringInputStream($string);
  return $this
    ->parse($input, $options);
}