1
0
Files
re_capitulating_queer/site/plugins/embed/vendor/oscarotero/html-parser
Philip Wagner 78b6c0d381 init
2024-08-31 10:01:49 +02:00
..
2024-08-31 10:01:49 +02:00
2024-08-31 10:01:49 +02:00
2024-08-31 10:01:49 +02:00
2024-08-31 10:01:49 +02:00
2024-08-31 10:01:49 +02:00
2024-08-31 10:01:49 +02:00

HTML parser

Simple utility to parse html strings to DOMDocument.

composer require oscarotero/html-parser

Usage

use HtmlParser\Parser;

$html = '<html><head></head><body>Hello world</body></html>';

//Convert a string to a DOMDocument
$document = Parser::parse($html);

//Convert a string to a DOMDocumentFragment
$fragment = Parser::parseFragment('<p>Hello world</p>');

//Convert a DOMDocument or DOMDocumentFragment to a string
echo Parser::stringify($document);
echo Parser::stringify($fragment);