php array implode with keys code example
Example 1: php implode as key value of object
$output = implode(', ', array_map(
function ($v, $k) { return sprintf("%s='%s'", $k, $v); },
$input,
array_keys($input)
));
Example 2: php implode array
$values = array_map('array_pop', $array);
$imploded = implode(',', $values);