In this tutorial, we are going to learn about how to concatenate the two strings in PHP.
Concatenation means joining of two strings into a single string.
To concatenate the two strings, we can use the period
. concatenation operator in PHP.
Here is an example:
$first = "hello "; $second = "king"; $result = $first . $second ; echo $result
Similarly, we can also use
.= operator in PHP.
$name = "john "; $name .= "james"; echo $name