문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top