Re: Inconsistent json_decode() results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/5/5 Michiel Sikma <michiel@xxxxxxxxxxxxxx>:

> 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)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux