implode函数可以将存储在数组里的多个字符串按照指定的格式和分隔符连接成一个字符串
<?php $date = array('01', '01', '2006'); $keys = array('php', 'string', 'function'); print("A formated date: ".implode("/",$date)."\n"); print("A keyword list: ".implode(", ",$keys)."\n"); ?>
上面的代码输出如下
A formated date: 01/01/2006 A keyword list: php, string, function