PHP 8.5.0 Beta 1 available for testing

Voting

: max(eight, nine)?
(Example: nine)

The Note You're Voting On

samstah at gmail dot com
15 years ago
We discovered using DOMDocument::saveHTML() that it converts to HTML 4.01 compatible markup; rather than XHTML. The simple answer is to use saveXML() instead, although this adds the XML declaration to the top.

To qjerry.com at gmail.com, thanks for the pointer below - but I think that the simplest way seems to be using:
<?php $domDocument->saveXML($domDocument->documentElement); ?>

Of course, if you're dealing with XHTML, this will strip any <!DOCTYPE> declarations in the document too.

<< Back to user notes page

To Top