note 76203 added to function.json-decode
| From: | EricaTsai at osu1 dot php dot net | Date: | Thu, 05 Jul 2007 01:43:29 +0000 |
| Subject: | note 76203 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128237@lists.php.net to get a copy of this message | ||
Hi, I was running into a weird behavior on our server that caused json_decode() to misinterpret
encoded objects. In particular, all strings that had quotes had their quotes escaped somewhere
during the encode() process. Then on calling decode(), json barfed. On my local machine, this
escaping of quotes didn't occur. Anyone know why? I have the same version of php (5.2.2)
running on the server and local machine. The server is hosted by MediaTemple (grid server). I was
able to fix this behavior by wrapping stripslashes() around my variables before decoding them.
----
Server IP: 64.71.164.2
Probable Submitter: 71.120.192.90
----
Manual Page -- http://www.php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/76203
Del: integrated -- https://master.php.net/note/delete/76203/integrated
Del: useless -- https://master.php.net/note/delete/76203/useless
Del: bad code -- https://master.php.net/note/delete/76203/bad+code
Del: spam -- https://master.php.net/note/delete/76203/spam
Del: non-english -- https://master.php.net/note/delete/76203/non-english
Del: in docs -- https://master.php.net/note/delete/76203/in+docs
Del: other reasons-- https://master.php.net/note/delete/76203
Reject -- https://master.php.net/note/reject/76203
Search -- https://master.php.net/manage/user-notes.php