PHP 并置运算符. 点
连接多个字符串
(php 中一个空格和多个空格字符串是一样的“— ” 和“—— ”)
<?php
$txt1="Hello world!";
$txt2="What a nice day!";
echo $txt1 . $txt2;
// 连接两个字符串
// $txt1." ".$txt2; 连接 txt1 空格 txt2
?>
Hello world!What a nice day!
<?php
$txt1="Hello world!";
$txt2="What a nice day!";
$txt3 = $txt1 . $txt2;
echo $txt3." "."coded by leechoy";
?>
Hello world!What a nice day! coded by leechoy