Created
April 18, 2019 02:39
-
-
Save lineharo/6dd7dc11febb988e64f9a55ec3ebd809 to your computer and use it in GitHub Desktop.
bitrix_getinfoblock.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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