[Solved] How can I do an implode on certain fields of a two-dimensional array? [closed]


PHP 5.5:

$result = join(',', array_column($data, 'user_id'));

5.3<=PHP<=5.4:

$result = join(',', array_map(function($item)
{
   return $item['user_id'];
}, $data));

PHP<5.3:

$result = join(',', array_map(create_function('$item', 'return $item["user_id"];')));

solved How can I do an implode on certain fields of a two-dimensional array? [closed]