You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<html>Hello, This is a test.<br />Does it work this time?</html>
Imo, this is valid HTML and it is also parsed correctly by DOMDocument. However, HTML5 parser will ignore the first line of text. We're using loadHTML() method.
Even this one works with DOMDocument:
Hello, This is a test.<br />Does it work this time?
According to Mozilla documentation:
html: The start tag may be omitted if the first thing inside the element is not a comment.
body: The start tag may be omitted if the first thing inside it is not a space character, comment, <script> element or <style> element.