Serializing XML With PHP - Linking Out
(Page 10 of 10 )
And that's about it for this article. Over the last few pages, I showed you how you to build an XML document tree even if your PHP build doesn't support the XML DOM, via the free add-on XML_Serializer class from PEAR. I showed you how to programmatically create an XML document from an array or an object, how to indent XML document nodes, how to attach attributes to elements, and how to customize the behaviour of the serializer. I also showed you to how to reverse-serialize XML documents into PHP arrays or objects for use within a PHP script, together with examples of how type hints could help to make this a more accurate process. Finally, I wrapped things up with a composite example that demonstrated a practical, real-world use for all this code - converting the data in a MySQL database into XML and writing it to a file.
All this is, of course, only the tip of the iceberg; there are an infinite number of possibilities with power like this at your disposal. To find out what else you can do with XML and PHP, I'd encourage you to visit the following links:
XML Basics, at
http://www.melonfire.com/community/columns/trog/article.php?id=78
XSL Basics, at
http://www.melonfire.com/community/columns/trog/article.php?id=82
Using PHP With XML, at
http://www.melonfire.com/community/columns/trog/article.php?id=71
XSLT Transformation With PHP And Sablotron, at
http://www.melonfire.com/community/columns/trog/article.php?id=97
Building XML Trees With PHP, at
http://www.melonfire.com/community/columns/trog/article.php?id=180
The XML and PHP book, at http://www.xmlphp.com/
'Till next time...be good!
NOTE Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |