# RSS XML PHP why wouldn't this work?

**URL:** <https://forum.kirupa.com/t/rss-xml-php-why-wouldnt-this-work/314531>\
**Category:** programming\
**Created:** [October 1, 2010, 12:31am UTC](https://forum.kirupa.com/t/rss-xml-php-why-wouldnt-this-work/314531 "2010-10-01T00:31:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)\
**Post date:** [October 1, 2010, 12:31am UTC](https://forum.kirupa.com/t/rss-xml-php-why-wouldnt-this-work/314531/1 "2010-10-01T00:31:15Z")

</div>

I’m trying to use an API that gives me an RSS feed in XML\_Unserializer data structure (whatever that means). The XML is stored in $event, and I have this code as the foreach()

```auto

foreach($event->item as $items){
        echo $items->title;
   }

```

Where:

\<rss version=“2.0”\>  
\<channel\>  
\<item\>  
\<title\>Rolling Stones\</title\>  
\</item\>   
\</channel\> \</rss\>

It keeps giving me an invalid argument error for the foreach().

Why would this be happening? It’s worked when I’ve done it in other applications.
