How to remove backslash on json_encode() function?

前端 未结 10 1848
逝去的感伤
逝去的感伤 2020-12-03 04:42

How to remove the (\\)backslash on a string? when using echo json_encode() ?

For example:



        
10条回答
  •  我在风中等你
    2020-12-03 05:09

    You do not want to delete it. Because JSON uses double quotes " " for strings, and your one returns

    "$(\"#output\").append(\"
    This is a test!<\/p>\")"
    

    these backslashes escape these quotes

提交回复
热议问题