Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63233 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47693 invoked from network); 24 Sep 2012 18:12:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2012 18:12:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:34697] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/75-17579-A92A0605 for ; Mon, 24 Sep 2012 14:12:42 -0400 Received: from [192.168.0.200] (5ad4bfa1.bb.sky.com [90.212.191.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id D61E6758025; Mon, 24 Sep 2012 14:12:38 -0400 (EDT) Message-ID: <5060A263.8080906@ajf.me> Date: Mon, 24 Sep 2012 19:11:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: ivan.enderlin@hoa-project.net CC: internals@lists.php.net References: <505C4A06.6040304@hoa-project.net> <5060A1C5.8070701@ajf.me> In-Reply-To: <5060A1C5.8070701@ajf.me> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] POST, content-type: application/json and json_decode From: ajf@ajf.me (Andrew Faulds) 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/