views:

23

answers:

2

I am using Google Analytics API in PHP. I am fetching JSON data which I am converting into Associative Array by using Json_decode however when try to access attribute dxp$dimension, it gives error since it evals $dimension as a separate variable.

How do I evaluate whole thing as an Index for fetching data?

Thanks

+2  A: 
$array['dxp$dimension']
zerkms
+1 See this [PHP manual page](http://php.net/manual/en/language.types.string.php) for an explanation on the difference between double and single quotes.
quantumSoup
+1  A: 

Use a single tick instead of double:

$array['variable$name'];
Ian P