Reversing the effect of `mysqli_real_escape_string`

后端 未结 2 781
野的像风
野的像风 2021-01-16 18:59

I am working on an application where user can create HTML templates and save them to the database.The templates consist of different components like text,image etc.When I tr

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-16 19:17

    stripslashes() will remove slashes from any string, and is useful when outputting escaped data.

    I believe you need to use this:

    json_encode($IdLessContent, JSON_UNESCAPED_SLASHES);

    with the UNESCAPED_SLASHES part, your data should be returned correctly.

提交回复
热议问题