I wrote this
$result = array();
array_map(function($row) use ($result) {
$result[$row->id] = array();
$result[$row->id]['geojson'] = $row->geojson;
}, $regions);
and $result
is empty at the end.
Is it possible to populate array this way?