php单引号的字符串只会转义 ‘ 和 \ 反斜杠其他转义都不会包括 例如 \n \t
例子:
print'I have gone to the store.D';
print'<br/>';
print'I\'ve gone to the store.D';
print'<br/>';
print'Would \\ you pay $1.75 for 8 ounces of tap wather?';
print'<br/>';
print'In double-quoted strings,newline is represented by \n';
print'<br/>';
print"In \' \\ double-quoted strings,newline is represented by \n";
运行结果:
1048

被折叠的 条评论
为什么被折叠?



