【问题标题】:Sending string in quotes from html to php将字符串中的引号从html发送到php
【发布时间】:2011-07-02 12:57:39
【问题描述】:

我有一个 html 表单标签,可以将此字符串发送到一个 php 文件:

value='network="export"'

在php中加载时显示为:

network=\"导出\

在 html 中使用的正确语法是什么,所以当在 php 中加载时,它会显示为:

network="export"

希望我的问题没有令人困惑,感谢您的帮助!

【问题讨论】:

  • 你确定它没有显示为network=\"export\" 吗?

标签: php html string syntax quotes


【解决方案1】:

听起来您在 php 配置中启用了magic quotes。该文档页面包含有关此设置的作用以及如何禁用它的信息。

【讨论】:

    【解决方案2】:

    如果字符串如下所示:network=\"export\",那么您可以使用以下命令删除斜线:​​stripslashes()

    这里的用法: http://www.php.net/manual/en/function.stripslashes.php

    【讨论】:

      【解决方案3】:

      听起来你需要在 PHP 中 disable magic quotes

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-11-09
        • 2017-11-15
        • 2017-10-08
        • 1970-01-01
        • 1970-01-01
        • 2016-11-19
        • 2014-05-31
        相关资源
        最近更新 更多