# HTML parser Simple utility to parse html strings to DOMDocument. ```sh composer require oscarotero/html-parser ``` ## Usage ```php use HtmlParser\Parser; $html = 'Hello world'; //Convert a string to a DOMDocument $document = Parser::parse($html); //Convert a string to a DOMDocumentFragment $fragment = Parser::parseFragment('

Hello world

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