Hash::extract
snippet in php

Hash::extract

user3179

// 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 
    )
);