I have a Map
such as:
$m = Map {
'sort' => 'created',
'order' => 'desc',
}
I want to turn that into a string:
'sort:created order:desc'
I can do this with arrays as explained in this SO answer:
implode(' ', array_map(($k, $v) ==> $k.':'.$v, array_keys($m), $m))
I've read the documentation of Map::items
and tried:
$m->items()->map(($key, $value) ==> print($key))
But this prints nothing.
I'm looking for a oneliner like with the arrays, no loops.