cakephp 3 hash extract key value code example
Example: Hash::extract
// input
$data = Array(
[0] => Array (
[Product] => Array (
[id] => 5
[product_number] => RT001C
))
[1] => Array (
[Product] => Array (
[id] => 7
[product_number] => RC001C
))
);
$data = Hash::extract($data, '{n}.Product');
// => output
$data = Array(
[0] => Array (
[id] => 5
[product_number] => RT001C
)
[1] => Array (
[id] => 7
[product_number] => RC001C
)
);