News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Parsing XML With SimpleXML
February 12, 2013 @ 12:48:34

On PHPMaster.com today there's a new tutorial introducing you to SimpleXML, a handy bit of functionality included with the base PHP install to make working with XML (well, reading it) much simpler.

Parsing XML essentially means navigating through an XML document and returning the relevant data. An increasing number of web services return data in JSON format, but a large number still return XML, so you need to master parsing XML if you really want to consume the full breadth of APIs available. Using PHP's SimpleXML extension that was introduced back in PHP 5.0, working with XML is very easy to do. In this article I'll show you how.

He starts with some basic usage of the SimpleXML parsing, giving an example XML to parse, the resulting object and how to access the data inside it. There's also a bit about dealing with namespaces in the XML you're parsing and a more practical example - parsing the output of a YouTube feed to get links to various videos.

0 comments voice your opinion now!
parse xml simplexml introduction tutorial


blog comments powered by Disqus

Similar Posts

Rob Richards\' Blog: Pro PHP XML and Web Services Contest

Matthew Weier O'Phinney: ZF2 Modules Quickstart (Screencast)

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)

Mike Willbanks' Blog: Zend Framework Cache Backend Libmemcached + Session Cache

Chris Renner's Blog: Gerrymandered Code: Extending Zend_Registry to globalize session vars


Community Events





Don't see your event here?
Let us know!


symfony framework library interview series community conference release list version artisanfiles language opinion introduction security voicesoftheelephpant podcast laravel composer tool

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework