How do I remove backslashes from data?

How do I remove backslashes from data?

johnemc2johnemc2 Posts: 4Questions: 2Answers: 0
edited December 2016 in Free community support

I have problem of stripping slashes from the date that's saved in a database.
The date isn't saved with slashes, it's saved in readable format as e.g. 12/12/2016.
When Datatables serves it up to use via ajax, it looks like: 12\/12\/2016

Datatables won't display it with the slashes, I think.
Can't use the php function, stripslashes($result), because it's an array. Thanks in advance.

jonathanryangrice.com/trips/retrieve.html

jonathanryangrice.com/trips/retrieve.php

Answers

  • johnemc2johnemc2 Posts: 4Questions: 2Answers: 0
    edited December 2016

    Update:
    I was able to prevent json_encode from escaping the forward slashes in the date by using...

    json_encode($res,JSON_UNESCAPED_SLASHES)

This discussion has been closed.