我是php的新手。我有一个很长的字符串,我不想在其中有换行符。在python中,我将通过执行以下操作来完成此操作:
new_string = ("string extending to edge of screen......................................."
+ "string extending to edge of screen..............................................."
+ "string extending to edge of screen..............................................."
)在PHP中有没有类似的东西我可以做?
发布于 2013-11-05 06:08:31
您可以使用以下格式:
$string="some text...some text...some text...some text..."
."some text...some text...some text...some text...some text...";在这里,只要每条语句以;结尾,就可以在多行之间使用concat操作符-- .不介意换新行。
或
$string="some text...some text...some text...some text...";
$string.="some text...some text...some text...some text...";其中每条语句都以一个;结尾,但这次我们使用了一个.=操作符,它与输入相同:
$string="some text...some text...some text...some text...";
$string=$string."some text...some text...some text...some text...";https://stackoverflow.com/questions/19778125
复制相似问题