I have an array of type
$records = array(
array(
'id' => 2135,
'first_name' => 'John',
'last_name' => 'Cena',
),
array(
'id' => 5623,
'first_name' => 'Peter',
'last_name' => 'Doe',
));
I want to display the output in the format of
[2135] => John Cena
[5623] => Peter Doe
I have been using following code to try to display my expected result but its not working.
$names = array_column($records, 'first_name' . 'last_name', 'id');
How can I concatenate two columns of array into one?