mysql函数 取出指定字段重新组成一维数组
array_column();
$a = array( array( 'id' => 5698, 'first_name' => 'Bill', 'last_name' => 'Gates', ), array( 'id' => 4767, 'first_name' => 'Steve', 'last_name' => 'Jobs', ), array( 'id' => 3809, 'first_name' => 'Mark', 'last_name' => 'Zuckerberg', ) ); $last_names = array_column($a, 'last_name'); print_r($last_names); //输出 Array ( [0] => Gates [1] => Jobs [2] => Zuckerberg )
本文来自博客园,作者:小ྀ青ྀ年້,转载请注明原文链接:https://www.cnblogs.com/dalaowang/p/10690695.html