What is solution of extract to array
I have array:
$arr = array(
'key1' => array(
'name' => 'Value 1'
),
'key2' => array(
'name' => 'Value 2'
)
);
I would like get results like this:
Array
(
[key1] => Value 1
[key2] => Value 2
)
In Cake 2.2 and lower works by Set::extract('{\w+}.name', $arr) but when I would like use Hash by Hash::extract($arr, '{\w+).name') the results not corectly (also Hash::extract($arr, '{s}.name') return incorect.
How do this using new Hash class?