我现在有这个:
$_words = "'".implode("','", $array_of_words)."'";
这给了我一个字符串:
'word','word2','word3'
如何修改它以获取
"word","word2","word3"
由于
答案 0 :(得分:23)
只需交换你的报价
$_words = '"'.implode('","', $array_of_words).'"';
答案 1 :(得分:0)
$result=array();
foreach ($array_of_words as $a1) {
$result[]='"'.$a1.'"';
}
$_words = implode( ',', $result );
echo $_words;
答案 2 :(得分:0)
$_words = implode( "','", $array_of_words );