| Generating XML Documents Using PHP | | Print | |
The creation or saving of XML data stored in files on disk is the final topic for this chapter. Using the skills that you have already acquired in this chapter or by consulting other chapters in this book, you know how to process World Wide Web forms or query MySQL databases using PHP.
In most cases, the act of creating XML data from variable data that you have already acquired using PHP is as simple as taking one of two steps:
-
If your data is stored in a series of strings or other common objects, write out XML elements and data as needed to a disk file using standard PHP output functions, the same as you would when storing text data to any other type of file.
-
If your data is stored in a specialized object designed for XML manipulationsuch as a DomDocument (DOM extension) or SimpleXMLElement (SimpleXML extension) objectcall the extension's unique function or property for writing the object tree out to an XML file on disk.
Functions and Properties for Storing XML Objects as Files
If you have altered data stored in XML objects managed by PHP extensions, such as the DOM or SimpleXML extensions, and want to write these altered XML trees to text-based XML files, you'll need to use one of the functions or properties shown in Table 9.11 to perform the conversion or output.
| Users' Comments (0) |
|
No comment posted