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:
A Quick PHP XMLWriter Class Tutorial XML & RSS
January 19, 2009 @ 11:19:52

The PHPBuilder.com has posted today looking to introduce you to a powerful XML creation tool in PHP5 installations - XMLWriter.

They jump right in and show it in action by creating a simple RSS document with one element inside. A call to the flush() method on your XMLWriter object is all it takes to output the XML.

They also change things up and bit and swap out the procedural code for a more object-oriented approach with a constructor that sets up the object and adds in some of the common RSS information. Their addItem() method is called to add in a sample item (in this case, an entry for a CD player product) and _endRSS() closes things off and runs that flush() to send it all back out.

You can find out more about XMLWriter (and its sister, XMLReader) in the PHP manual.

0 comments voice your opinion now!
xmlwriter tutorial rss class oop php5 xmlreader


blog comments powered by Disqus

Similar Posts

David Coallier's Blog: Namespaces has PHP 5.3 (Or the other way around)

Anthony Ferrara: Design Patterns - Programming With Anthony

Matthew Weier O'Phinney's Blog: Writing Gearman Workers in PHP

Zend Developer Zone: MySQLND, MySQL_UH and other goodies available to PHP programmers

Sameer Borate's Blog: Google Translation PHP wrapper


Community Events





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


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

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