Re: Inconsistent json_decode() results

From: Date: Wed, 05 May 2010 18:02:09 +0000
Subject: Re: Inconsistent json_decode() results
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-304921@lists.php.net to get a copy of this message
2010/5/5 Michiel Sikma <michiel@thingmajig.org>: > By the way, if you're stuck on 5.2.10, you could simply cast the result to > array: > > var_dump((array)json_decode('{"_urls": ["a", "b"]}')); I don't see a "available starting in 5.x.x" notice, so I think it's been there for a long time... http://www.php.net/json_decode Second parameter of true makes it return an array instead of a class (I just had to use this recently, that's why it popped in my mind)

« previous php.general (#304921) next »