NYCPHP Meetup

NYPHP.org

[nycphp-talk] parsing RSS feeds using the Unserializer

Dallas DeVries dallas.devries at gmail.com
Sun Apr 3 11:46:22 EDT 2005


I'm using the Unserialize pear class to parse out an RSS feed.

The problem I'm having is accessing the attribute with the colon in it. Does 
anyone know how to access this element such as this? 

$options = array('complexType' => 'object',"parseAttributes" => true,
"attributesArray" => false);
$unserializer =& new XML_Unserializer($options);
$status = $unserializer->unserialize($content);
$data = $unserializer->getUnserializedData();
foreach($data->channel->item as $item) {
echo $item->dc:creator;

stdClass Object
(
[title] => Diamond Mind 2005 Predicted Standings Out
[link] => http://ussmariner.com/?p=2378
[comments] => http://ussmariner.com/?p=2378#comments
[pubDate] => Thu, 31 Mar 2005 05:11:34 +0000
[dc:creator] => DMZ
[category] => General baseball
[guid] => http://ussmariner.com/?p=2378
.............

Thanks!
Dallas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050403/1d5c5cb1/attachment.html>


More information about the talk mailing list