Home >Backend Development >PHP Tutorial >PHP中输出问题?

PHP中输出问题?

WBOY
WBOYOriginal
2016-06-06 20:44:401088browse

在c# 中: var a=@"abc\\"; 输出时 \\不会被转义

在PHP中:

<code>$a=‘abc\\’;
echo $a;//  abc\
</code>

在php中怎么实现 c#那样即使是特殊的字符\,也可以原样输出了?

回复内容:

在c# 中: var a=@"abc\\"; 输出时 \\不会被转义

在PHP中:

<code>$a=‘abc\\’;
echo $a;//  abc\
</code>

在php中怎么实现 c#那样即使是特殊的字符\,也可以原样输出了?

echo addslashes($a);

nowdoc

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn