string implode(string
$glue
,
array
$pieces
)
string join(string
$glue
,
array
$pieces
)
implode()或 join()函数可以将数组
$pieces
中的元素用指定的字符
$glue
连接起来。
下面为大家举一个简单的例子,供学习参考。
例 2:
代码如下:
<?php
$fruits
=
array
('apple', 'banana', 'pear');
$str
= implode(", ",
$fruits
);
echo
$str
;
?>