The operator that connects two strings in PHP is the dot operator (.), and its syntax is $str1 . $str2. The dot operator joins two string values together, returning a new string. Notes include: only applies to string values, has lower priority, and can be used to concatenate arrays.
Operator to connect two strings in PHP
In PHP, you can connect two strings Use the dot operator (.).
Syntax:
$str1 . $str2;
Where:
$str1
and $str2
are The string to be concatenated. Example:
$str1 = "Hello"; $str2 = "world"; $result = $str1 . $str2; //结果为 "Hello world"
The dot operator concatenates $str1
and $str2
into new characters string$result
.
Note:
The above is the detailed content of What is the symbol that connects two strings in php?. For more information, please follow other related articles on the PHP Chinese website!