Complete PHP SimpleXML Reference
The asXML() function returns the XML document, from a SimpleXMLElement object, as a string.
This function returns FALSE on failure.
| Parameter | Description |
|---|---|
| file | Optional. If this parameter is specified, this function writes the XML to a file instead of returning it |
XML File
PHP Code
The output of the code above will be:
If you select "View source" in the browser window, you will see the following HTML:
Complete PHP SimpleXML Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|