I’m part of a team, using json_encode()
to change an array into a JSON string. I then save this string in my database. Our ORM then escapes the quotes in the string, so if I look in the database, the string is stored as something like this:
"{"id":6,"name":"Number five","color":"red"}"
I can obviously write a method to remove the escaping, but I wanted to check first: Is there an existing, built-in function for unescaping?
====
EDIT: The value is stored this way in the database. Even looking via the command-line mysql command shows this. And when it is re-fetched in my application, it also shows up with the slashes.
2
Answers
i hope this can help you:
you can do it by using stripslashes function of php.The stripslashes() function removes backslashes.