I would like to get only one index type from an php array
I have this array :
array(
array
(
"id"=>
"title"=>"ho"
..
),
array
(
"id"=>
"title"=>"hi"
..
),
..
);
i would like to get just "title" without foreach.
like :
array
(
"0"=>"ho"
"1"=>"hi"
)
thx
For PHP 5.4 Use array_column
array_column($arr, 'title');
you can use array_map function
print_r(array_map(function($element) { return $element['title'];}, $data));