I tested inline anonymous function with array_map here
array_map
and it worked but when I tried same with $user_meta it is not working.
$user_meta = Array ( [interest] => Array ( [0] => Array ) [type] => Array ( [0] => Array ) [user_status] => Array ( [0] => deny) [firstname] => Array ( [0] => ) [lastname] => Array ( [0] => B ) [email] => email@cc.com ) $user_meta = array_map(function($a) { return $a[0]; },$user_meta);
"Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in"
here is the test link showing error
I hope this will help:
$user_meta = array_map(function ($a) { return $a[0]; }, $user_meta);
1.4m articles
1.4m replys
5 comments
57.0k users