XMLWriter::openUri
(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL xmlwriter >= 0.1.0)
Create new xmlwriter using source uri for output
Description
Oop
Procedural
Creates a new XMLWriter using uri for the output.
Parameters
uriThe URI of the resource for the output.
Return Values
Oop: Success
Procedural: Returns a new XMLWriter instance for later use with the xmlwriter functions on success, Falseforfailure.
Changelog
| Version | Description |
|---|---|
| 8.0.0 | This function returns now an XMLWriter instance on success. Previously, a Resource has been returned in this case. |
Examples
Direct output of XML
It is possible to directly output XML by using the php://output stream wrapper.
<?php
$out =new XMLWriter();
$out->openURI('php://output');
?>Notes
On Windows, files opened with this function are locked until the writer is released.
See Also
XMLWriter::openMemory