Home > Article > Backend Development > What is the symbol used to connect two strings in php?
The symbol for connecting strings in PHP is dot (.). The method is as follows: place the string on both sides of the dot symbol. Dot notation can only concatenate values of type string. Variables need to be initialized. Multiple strings can be concatenated.
The symbol for connecting strings in PHP
The symbol for connecting two strings in PHP is point(.).
How to use:
Simply place two strings on either side of the dot symbol to concatenate them. For example:
<code class="php"><?php $str1 = "Hello"; $str2 = "World"; $str3 = $str1 . $str2; // 连接字符串 echo $str3; // 输出 "HelloWorld" ?></code>
Note:
The above is the detailed content of What is the symbol used to connect two strings in php?. For more information, please follow other related articles on the PHP Chinese website!