把数组元素组合为一个字符串

举例

跟JavaScript数组的join函数作用一致

<?php
$arr = array('Hello','World!','mofazhuan');
echo join(" ",$arr);
?>

输出结果

Hello World! mofazhuan


--------------

原创文章出自 木法传,如转载请注明本文链接:https://www.mofazhuan.com/410.html

--------------

2 对 “PHP 数组转换字符串,join() 函数”的想法;

  1. Long time reader, first time commenter — so, thought I’d drop a
    comment.. — and at the same time ask for a favor.

    Your wordpress site is very simplistic – hope you don’t mind me asking what theme you’re using?
    (and don’t mind if I steal it? :P)

    I just launched my small businesses site –also built in wordpress like yours– but
    the theme slows (!) the site down quite a bit.

    In case you have a minute, you can find it by searching for “royal cbd” on Google (would appreciate any feedback)

    Keep up the good work– and take care of yourself during
    the coronavirus scare!

    ~Justin

发表评论

电子邮件地址不会被公开。