文字列の分割

文字列を分割します。

$str = '1, 2, 3';
$values = explode(',', $str);
foreach ($values as $value) {
    echo $value;
}

出力結果は、配列へ変換されています。

1 2 3