I am getting error Illegal offset type on next segment of code (the condition within foreach method is causing an error):
$filter = [];
foreach ($properties[array_keys($properties)] as $prop)
array_add($filter, array_keys($prop), $prop->id);
And this is how $properties array look like. What I am trying to do is adding elements of array inside $properties into another array (etc. $filter['1'] = $properties['1']). The problem is that I never know how many elements (arrays) are going to be inside $properties and also I don't know what values are they going to be, so I can access them.
If there is an easier way to achieve this, feel free to write it down.
P.S.
id is element of array in $properties.
$propertiesvariable into$filter?