generic function for extracting values from an array with one particular key in PHP
- by Sabya
Is it possible in PHP to extract values from an array with a particular key path and return an array of those values? I'll explain with an example:
$user =
array (
array(
id => 1,
email =>'asd@example.com',
project => array ('project_id' => 222, 'project_name' => 'design')
),
array(
id => 2,
…