Alternate to array_column()

前端 未结 6 1443
我寻月下人不归
我寻月下人不归 2020-12-02 18:57

I have used array_column() in a project, and after uploading I found out that only PHP 5.5 or above support this function, and I think the hosting I use don\'t

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 19:09

    You can also use the alternative code of array_column(), it's simple just paste below line and replace your variable.

    Code:

    array_map(function($element){return $element['last_name'];}, $a);
    

提交回复
热议问题