Zend_Feed_Rss - Ben yankı ama ben başka bir şey yapamaz?

0 Cevap php

Belirli bir etiket durum yalnızca, belirli bir besleme kaynağından bazı yem haberi almak istiyorum.

$ Kategori bir dize değil, çünkü ben dolayısıyla strschr iade olmayacak, bunu almıyorum. (Ben inanıyorum).

 function ultimasNoticiasBlog()
   {
        $channel = new Zend_Feed_Rss('http:/something.com/?feed=rss2');

        $news = array();

        foreach ($channel as $item) {

            foreach ($item->category as $category)
            {
                //if any of the news has the tag "Sugestão"
                if (strchr($category,'Sugestão'))
                {
                    $news['find'] = "I have found a feed with your tag";
                }
                else
                {
                    echo 'Found Nothing';
                }
            }

          return $news;
      }
   }

However, if I do: echo $category" I get all categories printed on the viewport.

What am I not getting here? Please advice, MEM

UPDATE: To put it simple: If I do: var_dump($category); I get:

object(Zend_Feed_Element)#159 (3) {
  ["_element:protected"]=>
  object(DOMElement)#165 (0) {
  }
  ["_parentElement:protected"]=>
  NULL
  ["_appended:protected"]=>
  bool(true)
}

object(Zend_Feed_Element)#156 (3) {
  ["_element:protected"]=>
  object(DOMElement)#166 (0) {
  }
  ["_parentElement:protected"]=>
  NULL
  ["_appended:protected"]=>
  bool(true)
}

If I do: echo $category;

I get on the view port: SugestaoAnotherTag1AnotherTag2 ...

Ben neden ve, daha önemlisi, "Sugestao durum olup" olmadığını nasıl sonra görebilirsiniz göremiyorum anlayış değilim. : S

0 Cevap