1.字符串与数组的转换
implode 使用一个字符串将数组变成字符串
$array = array('lastname', 'email', 'phone'); $comma_separated = implode(",", $array); echo $comma_separated; // lastname,email,phone
explode 使用一个字符串分割另一个字符串,返回一个数组
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; $pieces = explode(" ", $pizza);