我想用字符串连接数组元素(例如-
:),我用 implode 尝试过,但它在我的代码中不起作用。
如何解决?
PHP:
<?php
$count = 1;
$ttttt = json_decode('["110,2"]');
$nnnnn = array("110","1","2");
$fffff = array('name','day','last');
$Rtp = str_replace($nnnnn, $fffff, $ttttt, $count);
echo implode(" - ", $Rtp); // This output is as: name,last
?>