I have this array
Array
(
[0] => Array
(
[column_name] => product_id
)
[1] => Array
(
[column_name] => product_name
)
[2] => Array
(
[column_name] => product_slug
)
)
and I need a array only with the names of the columns:
array('product_id', 'product_name', 'product_slug')
I made a empty array and iterate the main array like this:
$data = array();
foreach ($result as $key => $res) {
$data[] = $res['column_name'];
}
Is there any other method instead of iterating?