特定のタグが該当する場合のみ、特定のフィードソースからフィードニュースを取得したいと考えています。Zend_Feed_Rss - 私はエコーすることはできますが、何もできません。
$ categoryは文字列ではないので、strschrは返されません。 (私は信じる)。私がしなければ
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;
}
}
はしかし、: エコー$カテゴリは」私は、ビューポートに印刷すべてのカテゴリを取得
私はここで何を取得していない午前くださいアドバイス、 MEM
UPDATE:。? 私が行う場合 を::シンプルに言えば var_dump($category);
を私が取得:
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)
}
私が行う場合: echo $ category;
私はビューポートに乗る: SugestaoAnotherTag1AnotherTag2 ...
を私がなぜ、より重要に理解していないよ、私は「Sugestaoがケースであるかない」場合はどのように私はそれから見ることができます見ていませんよ。 :s