note 100565 added to function.json-encode
| From: | josh | Date: | Sat, 23 Oct 2010 19:31:59 +0000 |
| Subject: | note 100565 added to function.json-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173404@lists.php.net to get a copy of this message | ||
For anyone wondering whether umbrae's JSON pretty-printer will output invalid JSON (I did), I
ran some tests taking my valid JSON and replacing string values with each of the possible edge
cases: [, {, ,, :, ", }, and ]. I then ran the output through JSONLint just to verify.
So far as I can tell, nothing breaks in these situations, and everything pretty-prints as expected.
That said, quotes " will produce invalid JSON, but this is only an issue if you're using
json_encode() and just expect PHP to magically escape your quotes. You need to do the escaping
yourself.
----
Server IP: 69.147.83.197
Probable Submitter: 72.207.29.99
----
Manual Page -- http://www.php.net/manual/en/function.json-encode.php
Edit -- https://master.php.net/note/edit/100565
Del: integrated -- https://master.php.net/note/delete/100565/integrated
Del: useless -- https://master.php.net/note/delete/100565/useless
Del: bad code -- https://master.php.net/note/delete/100565/bad+code
Del: spam -- https://master.php.net/note/delete/100565/spam
Del: non-english -- https://master.php.net/note/delete/100565/non-english
Del: in docs -- https://master.php.net/note/delete/100565/in+docs
Del: other reasons-- https://master.php.net/note/delete/100565
Reject -- https://master.php.net/note/reject/100565
Search -- https://master.php.net/manage/user-notes.php