【问题标题】:why ' and " behaving differenlty in php [duplicate]为什么'和'在php中表现不同[重复]
【发布时间】:2013-02-06 17:59:59
【问题描述】:
echo '\n....'.$_SESSION['count'].' rows inserted.........................\n';
no new line using this

echo "\n....".$_SESSION['count']." rows inserted.........................\n";
gives new line with this 

为什么 ' 和 " 表现不同

【问题讨论】:

标签: php echo


【解决方案1】:

' 用于文字。 " 用于解析文本。

PHP Manual Strings

与双引号和heredoc 语法不同,变量和转义 特殊字符的序列在出现时不会被扩展 在单引号字符串中。

【讨论】:

    猜你喜欢
    • 2015-08-23
    • 1970-01-01
    • 1970-01-01
    • 2011-04-23
    • 2015-11-01
    • 1970-01-01
    • 2013-08-02
    • 2015-12-09
    • 1970-01-01
    相关资源
    最近更新 更多