implode -- Join array elements with a string

Description

string implode ( string glue, array pieces )

Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

例子 1. implode() example

<?php

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

echo $comma_separated; // lastname,email,phone

?>

上一篇: 用PHP来做zip压缩文件   下一篇: MYSQL可持续连接

提交疑问

请先登录 QQ微博登录

回顶部