/*
* 字符串
* a (char)
* this is a demo (string)
* 1.一个字符和多个字符都是字符串(PHP)
* 2.声明一个字符串必须使用 单引号 或 双引号引起来
* 3.字符串没有长度限制 """" " " "无限长"
* 4.在单引号中不可以使用双引号,在双引号中也可以使用单引号
* 5.在单引号中不能在使用单引号,在双引号中不能在使用双引号
* 6.可以使用转义字符 \
* ~单引号 和 双引号的区别~
* 1.在双引号中可以解析变量,而在单引号中不能解析变量
* 在双引号中有特殊字符可以分开,大括号也可以分开!
* 2.在双引号中可以使用转义字符 /n /r /t 在单引号中不能使用转义字符
* /(在单引号中只能转义单引号自己,还可以转义转义符号本身)
<?php
$int = 10;
$str = "this $int is a demo";
echo $str;
<?php
$int = 10;
$str = "this $intisademo"; // 没有断点就是变量
echo $str;
<?php
$int = 10;
$str = "this {$int}isademo"; // 双引号中有大括号,就直接解析大括号里的内容!
echo $str;
$str = "this{$int}is\nad\te\rmo";
echo $str;