Jam*_*mes -1 php string concatenation syntax-error echo
$text . = '1 paragraph';
$text . = '2 paragraph';
$text . = '3 paragraph';
echo $text;
Run Code Online (Sandbox Code Playgroud)
此代码给出错误syntax error, unexpected '='.
问题是什么?
我想你想要:
$text = '1 paragraph';
$text .= '2 paragraph';
$text .= '3 paragraph';
echo $text;
Run Code Online (Sandbox Code Playgroud)
请注意,第一行不使用.=,只是使用=