dongque5529 2012-12-25 04:25
浏览 692
已采纳

如何从PHP中删除JSON.stringify中的反斜杠? [重复]

Possible Duplicate:
Why does php insert backslash while replacing double quotes

How can you remove the backslashes from a JSON.stringify() after it is sent with AJAX?

The JSON before I send it does not have the backslashes, and afterwards it does. Are the backslashes always added by PHP when it encounters double quotes in a string?

Post-ajax output of JSON.stringify():

[
   {
      \"firstname\":\"John\",
      \"lastname\":\"Doe\"
   },
   {
       \"firstname\":\"Jane\",
       \"lastname\":\"Smith\"
   }
]
  • 写回答

2条回答 默认 最新

  • dongpao5658 2012-12-25 04:47
    关注

    Try php stripslashes function to remove them

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料