0

I have an empty array like the below,

$sample = [];

I need to add collections inside the empty array like the below.

$sample = [
{
'item1' : 12,
'item2' : 15,
'item3' : 18,
'item4' : 17
},
{
'item1' : 10,
'item2' : 25,
'item3' : 8,
'item4' : 7
}
];

How could I do that?

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114

0 Answers0