PHP: Separate array with commas
$output = array();
foreach($terms as $term){
$output[] = $term->name;
}
echo implode(', ', $output);
$output = array();
foreach($terms as $term){
$output[] = $term->name;
}
echo implode(', ', $output);