XMLWriter::startDocument
PHP function
Edit on GitHub ✎
(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL xmlwriter >= 0.1.0)
Create document tag
Description
Oop
XMLWriter::startDocument(string|null $version = "1.0", string|null $encoding = null, string|null $standalone = null): bool
Procedural
xmlwriter_start_document(XMLWriter $writer, string|null $version = "1.0", string|null $encoding = null, string|null $standalone = null): bool
Starts a document.
Parameters
versionThe version number of the document as part of the XML declaration.
encodingThe encoding of the document as part of the XML declaration.
standaloneyesorno.
Return Values
Success
Errors/Exceptions
Passing an encoding containing null bytes will throw a ValueError.
Changelog
| Version | Description |
|---|---|
| 8.4.0 | Passing an encoding containing null bytes will now throw a ValueError. |
See Also
XMLWriter::endDocument