Am 20.02.2011 11:32, schrieb Florin Jurcovici:
Hi. I have a JSON, let's say "{\"a b\": 13}". json_decode() handles it properly. However, then resulting object has a property composed of two words. What I did to access this property was the following: $json = "{\"a b\": 13}"; $decoded = json_decode($json); $tag = "a b"; print($decoded->$tag); However, this seems clumsy. Is there another, nicer way to access multi-word props in PHP? I suppose there should be, due to the loosely typed nature of PHP, where everything is a map, but I couldn't find it. br, flj
Ahoi, print($decoded->{"a b"}); Gruß -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php