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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -