Skip to content

Instantly share code, notes, and snippets.

@lineharo
Created April 18, 2019 02:39
Show Gist options
  • Save lineharo/6dd7dc11febb988e64f9a55ec3ebd809 to your computer and use it in GitHub Desktop.
Save lineharo/6dd7dc11febb988e64f9a55ec3ebd809 to your computer and use it in GitHub Desktop.
bitrix_getinfoblock.php
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
$news = CIBlockElement::GetList(["SORT"=>"ASC"],['IBLOCK_ID'=>13]);
$fp = fopen('dump_news.txt', 'a');
while($ob = $news->GetNextElement())
{
$arFields = $ob->GetFields();
$fields = $arFields[DATE_CREATE] . '$%$%$';
$fields .= $arFields[NAME] . '$%$%$';
$fields .= str_replace(array("\n","\r"), '', $arFields[DETAIL_TEXT]) . '$%$%$';
$fields .= $arFields[DETAIL_PAGE_URL] . PHP_EOL;
fwrite ($fp, $fields);
}
fclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment