Ask a question about json transmission and decoding. the ios client encodes the information into json and sends it to the server. the json string is {"date": "2999-01-01 00:00:00 "}, use post to send data to the server
When testing with a server, the received string is {\ "date \": \ "2999-01-01 00:00:00 \"}. then, the json_decode function can be used for normal decoding.
However, once I switched to a server, I found that the string received on this server was {\ "date \\\": \ "2999-01-01 00:00:00 \"}, the result of decoding with json_decode is wrong.
Why does the client transmit the same string differently on different web servers? the first case is what I need. how do I configure it?
Thank you!
Reply to discussion (solution)
$ Json = "{\" date \ ": \" 2999-01-01 00:00:00 \\\"}"; var_dump (json_decode (stripcslashes ($ json); // remove the escape character
$ Json = "{\" date \ ": \" 2999-01-01 00:00:00 \\\"}"; var_dump (json_decode (stripcslashes ($ json); // remove the escape character
Awesome! Thank you!