We all know that XML has great advantages going for it - it is human-readable, cross-platform, and easily converted into other forms. However, we all also know that it is not the fastest kid on the block when put up against binary formats.
So, how does a web developer harness the power of XML, whilst retaining as much performance as possible? Simple - use PHP's exceptionally fast XML module!
This chapter will teach XML parsing and manipulation using PHP, and requires that you are familiar with PHP as a language. Some familiarity with XML is required, although XML syntax and grammar is not mentioned in detail - the focus is PHP.
Important: if this is the first time you're working with XML, I strongly recommend you skip everything else and go straight to the SimpleXML module - it's the easiest way of working with XML, and it's the only thing I use nowadays.
Topics covered in this chapter are:
Standard XML manipulation
"SimpleXML" - the fast and easy way to use XML
XSL and transforming XML
Want to learn PHP 7?
Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!
If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!
Next chapter: Introduction to XML >>
Previous chapter: Next chapter
Home: Table of Contents
Copyright ©2015 Paul Hudson. Follow me: @twostraws.