PHP 8.5.0 Alpha 4 available for testing

Voting

: five minus zero?
(Example: nine)

The Note You're Voting On

mswiercz at mwerk dot com
20 years ago
Quick tip to minimize memory when generating documents with DOM.

Rather than using
$xmlStr = DOMDocument->saveXML();
echo $xmlStr;

to dump a large DOM to the output buffer, use a PHP output stream, as in

DOMDocument->save('php://output');

A lot of memory will be saved when generating large DOMs.

<< Back to user notes page

To Top