{
"testing":{
"number-1":{
"b":1,
},
"number-2":{
"b":1,
},
}
{
"testing":[{
"number-1":{
"b":1,
},
"number-2":{
"b":1,
}]
}
$array['testing'] = [];
foreach ($testing as $item)
{
$name = 'number-'.$item['id'];
$f[$name] = [
'b' => $item['rooms'],
];
array_push($array['testing'], $f);
}