News Feed
Sections




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

PHPBuilder.com:
The ABC's of PHP - Part 10 - The Final Installment (XML & Regex)
June 03, 2009 @ 08:48:31

PHPBuilder.com finishes off their "ABCs of PHP" series today with this last tutorial covering a script to fetch the latest headlines from Slashdot and parse the resulting XML with regular expressions.

Well my loyal readers (and you must be loyal if you've made it this far). Here we are at the final installment of the 'ABC's of PHP' where we are going to put some of what we've learned over the past couple of months into practice. We're going to go step by step through a small script to read the latest headlines from Slashdot.org [...] As the feed is very simple however, I decided to simply just use 'preg_xxx' calls to elaborate on the material from part 9 on using reg-ex calls, if you where reading anything more complex then you would almost certainly want to use the proper XML functions.

The actual parsing is pretty simple - grabbing each story, date, time and title element from the XML content and pushing it all into an array. The result is a nice array you can loop through and display via the method of your choosing.

0 comments voice your opinion now!
regularexpression xml tutorial


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Using Solarium with SOLR for Search Implementation

Chance Garcia's Blog: MAMP PRO, PECL, SSH2, and OSX CLI (AKA acronym madness)

WebReference.com: Globalize your Web Applications: PHP's Locale Package

PHPBuilder.com: BitMasks: Emulate Unix Permissions in PHP (Quickly)

MaltBlue.com: Basic CSV Output in Zend Framework 2


Community Events





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


release laravel tips threedevsandamaybe voicesoftheelephpant zendserver api symfony framework interview introduction deployment language code list community podcast series conference bugfix

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