我使用的是PHP版本5.5.12。当我连接字符串时,为什么我的浏览器会放一个<br />
?
假设我想给一个变量加括号,使其成为一个数组变量,如下所示:
$strName = $plyrMtchResult.'[]';
echo $strName;
假设$plyrMtchResult
是"Hello World"
,当我通过查看页面源查看页面时,我的浏览器会显示这一点:
'Hello World' <br />'.'[]'
我希望看到的是:$strName[]
在我的页面源中。如何使用concating将方括号添加到变量中?
谢谢你的帮助。。
这就是要做的吗
$withbrackets = '[' . $strName . ']';
我使用过:$strName=$plyrMatchResult。'['.']';$strName=preg_replace("'
'",",$strName);echo$strName;
明白了…我用的是:
$strName=$plyrMtchResult.'['.']';
$strName=preg_replace( "' <br />'", "", $strName );
echo $strName;