Documentation

GetNewsEx

Description and parameters

array
CIBlockRSS::GetNewsEx(
 string SITE,
string PORT,
string PATH,
string QUERY_STR,
 bool bOutChannel = false
);

Loads XML from specified address and parses into array. The user-agent's value uses "BitrixSMRSS". After uploading, XML will be converted into current site encoding. If errors occur, the results array will be empty. Non-static method.

Note: XML is cached at the specified time in the TTL, or, it time is not specified, caches for one hour.

Call parameters

Parameter Description Available from version
SITE IP address or site domain name.
PORTPort number to be connected. Default HTTP port -  80.
PATH and QUERY_STRConnected via question mark ("?") and passed HTTP command GET.
bOutChannel Requires to be true, if news items are located outside channel element.

Returned value

Array with displayed XML.

See Also

Examples

<?
$arRSS = CIBlockRSS::GetNewsEx('www.1c-bitrix.ru', '80', '/bitrix/rss.php', 'ID=news_sm&LANG=ru&TYPE=news&LIMIT=5');
print_r($arRSS);
?>

© «Bitrix24», 2001-2024
Up