Array(
[0] => Array ( [user_id] => 1 ) [1] => Array ( [user_id] => 22 )
)I only want 1 and 22. How to change it into $a=array('1','22');
欢迎选择我的课程,让我们一起见证您的进步~~
php版本要大于5.5.0 $userid_array = array_column($x,'userid'); php版本要大于5.4.0 $userid_array = array_map(function($item){return $item['userid'];},$x); 再低就for循环吧
array_map("current", two-dimensional array);
Do you need to query by column? Such a query can directly find the data of a one-digit array
$use_id = Db->table('table')->where([])->column('user_id');
array_map("current", two-dimensional array);
Do you need to query by column? Such a query can directly find the data of a one-digit array