Chris Andrews
asked on
How to use/display arrayed results from json decode? Example needed
Ok, I've got json data and decoded it with json_decode:
$data = json_decode($json_info,tru e);
when I do this:
var_dump($data);
I get results like this:
http://shoutkey.com/expulsion
Now that I've got that array.... I'm not sure how to use it.
Can you give me an example of code that will display the first six results for the ChannelName, DisplayTime and ProgramTitle, after they are parsed, so I have:
ChannelName value 1, DisplayTime value 1, ProgramTitle value 1
ChannelName value 2, DisplayTime value 2, ProgramTitle value 2
ChannelName value 3, DisplayTime value 3, ProgramTitle value 3
ChannelName value 4, DisplayTime value 4, ProgramTitle value 4
ChannelName value 5, DisplayTime value 5, ProgramTitle value 5
Big ask I know, I would really appreciate the help!
$data = json_decode($json_info,tru
when I do this:
var_dump($data);
I get results like this:
http://shoutkey.com/expulsion
Now that I've got that array.... I'm not sure how to use it.
Can you give me an example of code that will display the first six results for the ChannelName, DisplayTime and ProgramTitle, after they are parsed, so I have:
ChannelName value 1, DisplayTime value 1, ProgramTitle value 1
ChannelName value 2, DisplayTime value 2, ProgramTitle value 2
ChannelName value 3, DisplayTime value 3, ProgramTitle value 3
ChannelName value 4, DisplayTime value 4, ProgramTitle value 4
ChannelName value 5, DisplayTime value 5, ProgramTitle value 5
Big ask I know, I would really appreciate the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I had to change the 'for' to this:
for ($i = 0; $i <= 5; $i++) { //based on example at php.net
but you got me going in the right direction here - thank you very much!
Chris