Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP asXML() Function

PHP asXML() Function

PHP SimpleXML Reference Manual PHP SimpleXML Reference Manual

Example

Format the data of a SimpleXML object in XML (version 1.0):

Tove Jani Reminder Don't forget me this weekend! XML; $xml=new SimpleXMLElement($note); echo $xml->asXML(); ?>

Run Example »


Definition and Usage

The asXML() function formats the data of a SimpleXML object in XML (version 1.0).


Syntax

asXML(

filename

);

Parameters Description
filename Optional. Specifies the name of the file to which the data should be written.

Technical Details

Return Value: Returns a string on success or FALSE on failure. If the *filename* parameter is specified, returns TRUE on success and FALSE on failure.
PHP Version: 5.0.1+

PHP SimpleXML Reference Manual PHP SimpleXML Reference Manual