[nycphp-talk] parsing RSS feeds using the Unserializer
Hans Zaunere
lists at zaunere.com
Mon Apr 4 08:02:53 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
Variables shouldn't have a colon in their name.
http://www.php.net/manual/en/language.variables.php
H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050404/ae1a0c5f/attachment.html>
More information about the talk
mailing list