Re: POST, content-type: application/json and json_decode
| From: | Andrew Faulds | Date: | Mon, 24 Sep 2012 18:11:47 +0000 |
| Subject: | Re: POST, content-type: application/json and json_decode | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63233@lists.php.net to get a copy of this message | ||
On 24/09/12 19:09, Andrew Faulds wrote:
I think perhaps that's the wrong approach. It's valid JSON to have a list literal at the top level as well, Excuse my brief brain lapse. PHP arrays are fine for sequential data as well, and you could also have any other JSON literal value in $_POST.(Although, decoding objects to arrays would be inconvenient, I'd much prefer to decode to objects, and doing that might be confusing considering $_POST is usually an associative array...) -- Andrew Faulds http://ajf.me/