DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Set::extract - Parsing An RSS Feed For All Post Titles

02.28.2007
| 5457 views |
  • submit to reddit
        // description of your code here
http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/

The following code will produce the result:
Array
(
    [0] => How-to: Use Html 4.01 in CakePHP 1.2
    [1] => Looking up foreign key values using Model::displayField
    [2] => Bug-fix update for SVN/FTP Deployment Task
    [3] => Access your config files rapidly (Win32 only)
    [4] => Making error handling for Model::save more beautiful in CakePHP
    [5] => Full content RSS feed
    [6] => Visual Sorting - Some Javascript fun I had last night
) 

uses('Xml');
 
$feed = xmltoArray(new XML('http://feeds.feedburner.com/thinkingphp'));
$postTitles = Set::extract($feed, 'rss.channel.item.{n}.title');