有没有办法不扩展转义序列? [英] Is there a way to not expand escape sequences?

查看:79
本文介绍了有没有办法不扩展转义序列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。


[PHP] $ str ="这是\ nna球;

echo $ str; [/ PHP]


有没有一种方法可以使文本保持原样,而不会扩展转义序列。我知道单引号字符串不会扩展转义序列。但我需要回复用户在html textarea中输入的文本。这就是为什么我不想扩展转义序列。


谢谢,

Hanaa

Hello there.

[PHP]$str="This is \na ball";
echo $str;[/PHP]

Is there a way i can make the text to be as is, without expanding the escape sequences. I know that single quoted strings do not expand escape sequences. But I need to echo text that''s been entered by the user in a html textarea as is. And thats why I dont want the escape sequences to be expanded.

Thanks,
Hanaa

推荐答案

str ="这是\ nna球" ;;

echo
str="This is \na ball";
echo


str; [/ PHP]


有没有办法让文本保持原样,而不扩展转义序列。我知道单引号字符串不会扩展转义序列。但我需要回复用户在html textarea中输入的文本。这就是为什么我不希望扩展转义序列。


谢谢,

Hanaa
str;[/PHP]

Is there a way i can make the text to be as is, without expanding the escape sequences. I know that single quoted strings do not expand escape sequences. But I need to echo text that''s been entered by the user in a html textarea as is. And thats why I dont want the escape sequences to be expanded.

Thanks,
Hanaa


你可以删除它们
You could just remove them
展开 | 选择 | Wrap | 行号


这篇关于有没有办法不扩展转义序列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆