我array_map herearray_map联匿名函数
测试联匿名函数,它的工作,但是当我试图用相同user_meta它不工作..
$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 protected])
$user_meta = array_map(function($a) { return $a[0]; },$user_meta);
“解析错误:语法错误,意外T_FUNCTION,预计 ')' 在”
here is the test link showing error
你的$ user_meta数组的定义是无效的PHP阵列,它的的print_r()输出,格式为人类可读性 –
附:内联匿名函数只能在PHP 5.3+中工作 –
@Paulpro为什么要回滚格式更改? – jmattheis