【问题标题】:Strip slashes from database request correctly正确地从数据库请求中去除斜杠
【发布时间】:2011-12-18 09:56:48
【问题描述】:

我的数据库中存储了包含斜杠的消息:例如不要

为了呈现信息,我使用了这个过程。问题是反斜杠仍然显示。 我怎样才能摆脱它。 我已经尝试了很多事情,并在这里阅读了几篇帖子,但无法让它发挥作用。任何人都在这里帮助我并告诉我什么是最好的方法..

            $msg2 = html_entity_decode($row3[comment]);
            echo stripslashes(nl2br($msg2));

【问题讨论】:

    标签: php stripslashes


    【解决方案1】:

    将它们存储在数据库中时,应将它们存储为mysql_real_escape_string($phpString)

    你为什么要使用html_entity_decode?只需stripslashes 就足够了..

    【讨论】:

      猜你喜欢
      • 2021-09-01
      • 2019-10-26
      • 1970-01-01
      • 1970-01-01
      • 2018-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多