-7
Hello I see that it is a very simple question apparently but I am finding a lot of difficulty in doing this, I must probably be looking the wrong way on the subject, what I am trying to do is the following:
$var3 = $var1." ".$var2;
In the case var3 would receive the string var1 + var2 with a space between them, but that way I can’t achieve what I want, any way to do it in this style? (simply).
EDIT: I tested the code and now it worked, probably should have had some error at the time of execution.
If
$var3
doesn’t get what you want, so what do you want? Isn’t the space between the values of$var1
and$var2
?– Woss
What I want is that it receives the var1 + var2 with a space between them, for example if the content of var1 is car and var2 is plate the result comes out as follows: carroplaca however I want to exit car plate (with space between them).
– Wel
$var1 and $var2 have value?
– Fabricio
@Wel Question code generates result without space? Are you absolutely sure about this? Look at this...
– Woss
Try this example: http://php.net/manual/en/language.operators.string.php
– Fabricio
In my test at least yes (I’m using php version 5 if it makes a difference).
– Wel
@Wel No, the result is the same, with the space, in all versions, since the 4.3.0, at least. See details.
– Woss
I really tested with the same situation and it worked here.
– Wel