Jump to content

First steps in JSON


herghost

Recommended Posts

Hi all,

 

I am sure this is simple, but I just can't wrap my head around a suitable way of doing this!

 

Basically I have my JSON result as something like :

 

Array ( [result] => success [source] => gotBits [success] => 64 ) 

 

What I simply want to do is get the [success] output and store it as a variable.

 

I have been looking at json_decode, but I cant find any examples for arrays, just strings?

 

Can you push me in the right direction?

Link to comment
https://forums.phpfreaks.com/topic/254464-first-steps-in-json/
Share on other sites

Hi dude still i m not completely cleared but

 

If you are getting value in an array format than u don't u store it in a variable and than use that variable to get that data example

$valueHolder = $json->call('getBits',Array());

 

print_r($valueHolder['success']);

Link to comment
https://forums.phpfreaks.com/topic/254464-first-steps-in-json/#findComment-1304754
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.