> Concatenation operator in php ~ Online tutorial

Concatenation operator in php

The Concatenation Operator
There is only one string operator in PHP.
The concatenation operator (.) is used to put two string values together.
To concatenate two string variables together, use the concatenation operator:

Example

?php
$txt1="Hello World!";
$txt2="What a nice day!";
echo $txt1 . " " . $txt2;
?

The output of the code above will be:
Hello World! What a nice day! 

If we look at the code above you see that we used the concatenation operator two times. This is because
we had to insert a third string (a space character), to separate the two strings.

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: