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

PHP中输出问题?

WBOY
Release: 2016-06-06 20:44:40
Original
1088 people have browsed it

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

在PHP中:

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

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

回复内容:

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

在PHP中:

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

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

echo addslashes($a);

nowdoc

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template