I'm using PHP version 5.5.12. Why is my browser putting a <br />
when I am concatinating strings?
Let's say I want to add brackets to a variable to make it into an array variable like this:
$strName = $plyrMtchResult.'[]';
echo $strName;
Assuming $plyrMtchResult
is "Hello World"
, my browser show this when I view the page via view page source:
'Hello World' <br />'.'[]'
What I would like to see is: $strName[]
in my page source. How can I add brackets to my variable using concatinating?
Thanks for helping..
Is this what you are trying to do
$withbrackets = '[' . $strName . ']';
I used: $strName=$plyrMtchResult.'['.']'; $strName=preg_replace( "'
'", "", $strName ); echo $strName;
Got it...I use :
$strName=$plyrMtchResult.'['.']';
$strName=preg_replace( "' <br />'", "", $strName );
echo $strName;