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 need to use period
. concatenation operator in PHP.
Here is an example:
$first = "hello "; $second = "king"; $result = $first . $second ; echo $result
Similary, we can also use
.= operator in PHP.
$name = "john "; $name .= "james"; echo $name