O'Reilly logo

XML Parsing with PHP by John M. Stokes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic SimpleXML

Parsing with SimpleXML

Occasionally users, and even programmers, are confused by the word parsing. It just means “getting meaning from data.” When you see THE, it’s the difference between seeing a cross, a goalpost, and a one-sided ladder and reading the word “the”. So when we speak of “parsing” an XML file, we mean we’re going to load the data and do something meaningful with it instead of just echoing it back to the screen unchanged.

In my experience, reading and manipulating data occur much more often than writing it does. Consequently, we’ll start by examining how to do just that. Fortunately, reading and doing simple manipulations are where SimpleXML excels.

Almost every SimpleXML object is instantiated by importing a well-formed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required