Implode a column of values from a two dimensional array [duplicate]

Simplest way, when you have only one item in inner arrays:

$values = array_map('array_pop', $array);
$imploded = implode(',', $values);

EDIT: It’s for version before 5.5.0. If you’re above that, see better answer below 🙂

Leave a Comment