PHPバージョン
4+
$colors = ['red', 'green', 'blue'];
$comma_separated = implode(', ', $colors); // ',' で区切って連結

echo $comma_separated; // 出力: 'red, green, blue'
join(string $separator, array $array): string
$fruits = ['apple', 'banana', 'orange'];
$fruits_string = join(', ', $fruits);

echo $fruits_string; // 出力: 'apple, banana, orange'
$items = ['Item 1', 'Item 2', 'Item 3'];
$html_list = '<ul><li>' . join('</li><li>', $items) . '</li></ul>';

echo "HTML List:\n" . $html_list;
結果の出力
class StringArray {
    protected $title;

    public function __construct($title)
    {
        $this->title = $title;
    }

    public function __toString()
    {
        return $this->title;
    }
}

$array = [
    new StringArray('春'),
    new StringArray('夏'),
    new StringArray('秋'),
	new StringArray('冬')
];

echo join(' ', $array); // 出力: '春' '夏' '秋' '冬'
$booleans_array = [true, true, false, false, true];
$result = join('', $booleans_array);

var_dump($result); // 出力: string(3) '111'
// trueは'1'になり、falseは何も出力されません。