php - array - Illegal string offset -


I am trying to display a single value from an array of values. If I use print_r ($ arr) then this value shows

  {"a": 14, "b": 3, "c": 61200, "d": ["2014- 04-22 12:00:06 "," 2014-04-23 12:00:06 "," 2014-04-24 12:00:06 "]}   

but when I changed my code to echo $ arr-> An attempt was made to use a and $ arr ['a'] it shows invalid string offset 'a' . How to get a single value from an array of values?

looks like json first

  $ d = '{"a": 14, "b": 3, "c": 61200, "d": ["2014-04-22 12:00:06", "2014 -04-23 12:00:06" , "2014-04-24 12:00:06"]} '; $ J = json_decode ($ d); Echo '& lt; Pre & gt; '; Print_r ($ j); Counterpart $ j-> A;    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -