You could use array_map() and implode()...
array_map()
implode()
$a = array_map(function($obj) { return $obj->foo; }, array(1=>$obj1 , 2=>$obj2 , 3=>$obj3));$a = implode(", ", $a);
With PHP 7.0+ you can use array_column for this.
array_column
echo implode(',', array_column($a, 'foo'));
This is actually the best way I've found, it doesn't seem to be answered here properly as the array of objects should be able to handle dynamic size.
$str = implode(',', array_map(function($x) { return $x->foo; }, $a));