I have am array containing these elements: id, email, type
I want to remove type and id and preserve email.
I have echoed and print_r the array and the subsequent elements and everything is fine.
But for filtering through the arrays and returning only the list emails, the following code is written, which, however does not work:
$arr = array_walk($final_list, function($var){
return $var['email'];
});
While if I echo $var['email'] it echoes the emails accordingly.
array_walkis not the best function to use in this instance. I would suggest you take a look atarray_column.