你在找 implode()

$string = implode(",", $array);

使数组成为一个变量并使用内爆。

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);


echo $comma_separated; // lastname,email,phone

Http://php.net/manual/en/function.implode.php

直接来自 医生:

$comma_separated = implode(",", $array);
$arr = array ( 0 => "lorem", 1 => "ipsum", 2 => "dolor");


$str = implode (", ", $arr);