не могу переобразовать в json пробую ,но не вышло json_encode($prop, JSON_FORCE_OBJECT);
$prop = Array
(
[0] => Array
(
[NAME] => ИДН 500 - средний элемент
[PREVIEW_PICTURE] => /upload/iblock/501/IDN_500_S_2.jpg
[PRICE] => 1575.00
)
[1] => Array
(
[NAME] => ИДН 500 - концевой элемент
[PREVIEW_PICTURE] => /upload/iblock/c2c/IDN_500_K_2.jpg
[PRICE] => 788.00
)
)
<? require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
if(!CModule::IncludeModule("iblock"))
return;
$idarr = $_POST;
$prop = array();
$count = 0;
foreach ($_POST as $id){
$res = CIBlockElement::GetByID(+$id);
if($ar_res = $res->GetNext()) {
$prop[$count]['NAME'] = $ar_res['NAME'];
$prop[$count]['PREVIEW_PICTURE'] = CFile::GetPath($ar_res['PREVIEW_PICTURE']);
$prop[$count]['PRICE'] = CPrice::GetBasePrice($ar_res['ID'])['PRICE'];
}
$count++;
}
echo \Bitrix\Main\Web\Json::encode($prop);
?>