8

我现在有这个:

$_words = "'".implode("','", $array_of_words)."'";

这给了我一个像这样的字符串:

'word','word2','word3'

我怎样才能修改它以获得

"word","word2","word3"

谢谢

4

3 回答 3

29

只是交换你的报价

$_words = '"'.implode('","', $array_of_words).'"';
于 2013-01-21T14:28:45.880 回答
0
$result=array();
foreach ($array_of_words as $a1) {
    $result[]='"'.$a1.'"';
}
$_words = implode( ',', $result );
echo $_words;                   
于 2013-10-14T10:35:10.490 回答
0

$_words = implode( "','", $array_of_words );

于 2016-01-02T23:44:13.327 回答