note 129991 added to dom-htmldocument.createfromstring

From: Date: Wed, 22 Jan 2025 03:34:11 +0000
Subject: note 129991 added to dom-htmldocument.createfromstring
Groups: php.notes 
Request: Send a blank email to php-notes+get-221807@lists.php.net to get a copy of this message
To load HTML without doctype, html, body elements use LIBXML_HTML_NOIMPLIED flag. <?php $html = <<<EOT <div class="row"> <div class="col"><h1 id="heading" class="col1-heading">Hello</h1></div> <div class="col"><p class="paragraph">Hello world.</p> </div> EOT; $doc = \DOM\HTMLDocument::createFromString($html, LIBXML_HTML_NOIMPLIED); echo htmlspecialchars($doc->saveHTML(), ENT_QUOTES); ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 184.22.231.131) ---- Manual Page -- https://php.net/manual/en/dom-htmldocument.createfromstring.php Edit -- https://main.php.net/note/edit/129991 Del: integrated -- https://main.php.net/note/delete/129991/integrated Del: useless -- https://main.php.net/note/delete/129991/useless Del: bad code -- https://main.php.net/note/delete/129991/bad+code Del: spam -- https://main.php.net/note/delete/129991/spam Del: non-english -- https://main.php.net/note/delete/129991/non-english Del: in docs -- https://main.php.net/note/delete/129991/in+docs Del: other reasons-- https://main.php.net/note/delete/129991 Reject -- https://main.php.net/note/reject/129991 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221807) next »