![php](https://habrastorage.org/r/w120/files/373/e8b/dd3/373e8bdd3cb644d3bbeba47d34d1876d.png)
PHP
2
Вклад в тег
$test = array();
foreach($products as $product){
$test[] = array(
"id"=>$product->id,
"title"=>$product->title,
"param"=>array(
"param1"=>21,
"param2"=>2,
),
);
}
echo json_encode($test);