Serving XHTML and self-closing tags I am trying to follow the xhtml 1.0 strict standard as I am creating my website. Right now, validator.w3.org validates my document as valid, following the XHTML 1.0 Strict standard. Here is a code-example: <div style="color:#f00"><div style="color:#00f" />Text should be red and not blue</div> Unfortunately, Firefox, Chrome and Internet Explorer parses the document incorrectly: They all seem to ignore the closing statement of my self-closing tags (mostly <div />, <li /> and some other tags), thus rendering the site
undefined
How do you parse and process HTML/XML in PHP? How can one parse HTML/XML and extract information from it? This is a General Reference question for the php tag Answer: Native XML Extensions I prefer using one of the native XML extensions since they come bundled with PHP, are usually faster than all the 3rd party libs and give me all the control I need over the markup. DOM The DOM extension allows you to operate on XML documents through the DOM API with PHP