Pergunta

Hi i use SimplePie in this way:

$feed = new SimplePie();
$feed->set_feed_url( array("feed.xml", "feed2.xml") );
$feed->enable_cache(false);
$feed->init();
$feed->handle_content_type();

var_dump($feed->get_language());

foreach ($feed->get_items() as $item):

get_language() return NULL .. I miss something?

Is possible get the language of each Item? Thanks.

Foi útil?

Solução

The language element is optional in the RSS specification, if it doesn't have one the author didn't supply it. The likelihood is it's en when get_language() returns null, which is probably about the safest assumption you can make.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top