English 中文(简体)
PHP: implode
原标题:PHP: implode( , $appArray) generates extra
  • 时间:2009-09-26 06:57:01
  •  标签:

我有以下阵列:

$appArray=array( a ,  b ,  c );

I want to produce output such as a b c . The trouble is that when I use

implode( 
 , $appArray)

页: 1

如何解决这一问题的想法?

最佳回答

Are you sure you re not intending: implode(" ", $appArray)? Newline characters aren t actually treated as newline characters when encapsulated in single quotes .

问题回答

使用PHP_EOL(线末):

implode(PHP_EOL, $array);

Actually, in single quotes means (literally), not carriage return. Try using double quotes in implode ().

Try enclosing the in double quotes.

就像他们重新被解读为两种特性一样:反弹和反射,反弹越出。

你可以尝试这样做。

  $selected = implode(",
", preg_replace( /^(.*?)$/ , " $1 ", $filters[ selected_model ]));


SELECT DISTINCT(D.model_id) AS MODEL_ID, COUNT(*) AS viewCount, t.title FROM download_logs AS D LEFT JOIN templates AS t ON D.model_id = t.id 
        WHERE D.model_type IN ( .$selected. ) GROUP BY D.model_id




相关问题
热门标签