$name = 'yutuo'; // 单引号字符串 echo 'My name is $name'; // 单引号字符串 echo "My name is $name"; echo "My name is {$name}"; // here文档字符串 echo <<< end My name is $name My name is {$name} end;
其结果为(输出没有任何换行,为了容易理解,我在结果里换行了): My name is $name My name is yutuo My name is yutuo My name is yutuo My name is yutuo