PHP转义字符

三种方法:
1.使用双引号中插入单引号
2.使用单引号,但是加上转义字符
3.使用eof输出
代码:

第一种方式:echo "that's ok";
第二种方式:echo 'that\'s ok';
第三种方式:echo <<<eof
           that's ok
           eof;

效果图:
在这里插入图片描述

发布了42 篇原创文章 · 获赞 67 · 访问量 5271

猜你喜欢

转载自blog.csdn.net/weixin_42299610/article/details/103465953
今日推荐