hash 3a 3aextract

Solutions on MaxInterview for hash 3a 3aextract by the best coders in the world

showing results for - "hash 3a 3aextract"
Chiara
23 Aug 2020
1// input
2$data = Array(
3    [0] => Array (
4            [Product] => Array (
5                    [id] => 5
6                    [product_number] => RT001C
7                ))
8    [1] => Array (
9            [Product] => Array  (
10                    [id] => 7
11                    [product_number] => RC001C 
12                ))
13);
14
15$data = Hash::extract($data, '{n}.Product');
16// => output
17$data = Array(
18  	[0]	=> Array (
19      	[id] => 5
20      	[product_number] => RT001C
21    )
22    [1] => Array (
23     	[id] => 7
24      	[product_number] => RC001C 
25    )
26);
27