Documentation

FormatArray

Description and parameters

array
CIBlockRSS::FormatArray(  array arRes,  array bOutChannel = false
);

Method converts result of method CIBlockRSS::GetNewsEx to a more satisfactory display. Non-static method.

Call parameters

Parameter Description Available from version
arRes Array with XML description. Result of method CIBlockRSS::GetNewsEx.
bOutChannel Parameter must be synchronized with the method CIBlockRSS::GetNewsEx.

Returned value

Array as follows:

  • title - RSS feed title;
  • link;
  • description;
  • lastBuildDate - time in RSS format (see. CIBlockRSS::XMLDate2Dec);
  • ttl - time in minutes;
  • image - image description:
    • title;
    • url;
    • link;
    • width;
    • height;
  • item - array with item news:
    • title - news title;
    • link;
    • description;
    • enclosure - attachment (optional):
      • url;
      • length;
      • type;
      • width - optional;
      • height - optional;
    • category;
    • pubDate - time in RSS format (see. CIBlockRSS::XMLDate2Dec);

See Also

Examples

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


© «Bitrix24», 2001-2024
Up