#native_company# #native_desc#

Converting XML into a PHP data structure

By PHP Builder Staff
on December 25, 2002

Does It Taste As Good As It XMLs?

In the last few years, XML has received great media attention, and most
languages support the parsing and extraction of data from XML documents.
Besides being a great three-letter anacronym to sprinkle on your
resumé, XML is actually a useful data storage structure
for PHP programmers.
Before you begin to use XML, you must first determine if your project
really needs what XML offers. There are alternative data storage formats
like fixed-width column files, tab-delimited files, CSV files, and database
tables, but these formats typically can only manage a simple grid of
rows and columns of data. XML provides several additional benefits for
programmers including:
  • data format abstraction,
  • simple document tag/data validation,
  • the ability to store data in a tree-like heirarchy,
  • platform independence,
  • ease of integration,
  • and more…
…but you already know that. What you want to do is use XML data inside
your sparkling new web application. We’ll explore one simple way to do
this in the remainder of this article.