note 127117 added to domdocument.loadhtml
| From: | Anonymous at main dot php dot net | Date: | Thu, 19 May 2022 16:05:36 +0000 |
| Subject: | note 127117 added to domdocument.loadhtml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-218496@lists.php.net to get a copy of this message | ||
loadHTML() & loadHTMLFile() may always generate warnings if the html include some tags such as
"nav, section, footer, etc" adopted as of HTML5 (in PHP 8.1.6).
Try to run below.
<?php
$file_name = 'PHP Runtime Configuration - Manual.html'; // Download this file from
"https://www.php.net/manual/en/session.configuration.php"
in advance.
$doc = new DOMDocument();
$doc->loadHTMLFile($file_name); // if set "LIBXML_NOERROR" as 2nd arg, no error
echo $doc->saveHTML();
// Warning: DOMDocument::loadHTMLFile(): Tag nav invalid in PHP Runtime Configuration - Manual.html,
line: 63 in D:\xampp\htdocs\test\xml(dom)\loadHTML\index.php on line 6
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.47 (proxied: 153.197.125.114)
----
Manual Page -- https://php.net/manual/en/domdocument.loadhtml.php
Edit -- https://main.php.net/note/edit/127117
Del: integrated -- https://main.php.net/note/delete/127117/integrated
Del: useless -- https://main.php.net/note/delete/127117/useless
Del: bad code -- https://main.php.net/note/delete/127117/bad+code
Del: spam -- https://main.php.net/note/delete/127117/spam
Del: non-english -- https://main.php.net/note/delete/127117/non-english
Del: in docs -- https://main.php.net/note/delete/127117/in+docs
Del: other reasons-- https://main.php.net/note/delete/127117
Reject -- https://main.php.net/note/reject/127117
Search -- https://main.php.net/manage/user-notes.php