Здравствуйте, не могу осилить проблему, есть код
<?php $inn = '123';
$positions = array();
foreach ($dbBasketItems->arResult as $result){
$positions[] = array(
'quantity' => intval($result['QUANTITY']),
'price' => $result['PRICE'] * $result['QUANTITY'],
'tax' => '6',
'text' => $result['NAME']
);
}
$merchantReceipt = array(
'inn' => $inn,
'skipAmountCheck' => '1',
'group' => 'Main',
'content' => array(
'type' => '1',
'positions' => $positions,
'customerContact' => $user_email
)
);
echo json_encode($merchantReceipt);
?>
print_r выдает
merchantReceipt=Array ( [inn] => 770701062094
[skipAmountCheck] => 1
[group] => Main
[content] => Array (
[type] => 1
[positions] => Array ( [0] => Array
( [quantity] => 1 [price] => 29700 [tax] => 6 [text] => Кровать)
[1] => Array ( [quantity] => 1 [price] => 23000 [tax] => 6 [text] => Матрас) ) [customerContact] => test@yandex.ru ) )
если вывести через json_encode, то выводится одна скобка {