xxxxxxxxxx
object(stdClass)#5 (2) {
["status"]=>
string(2) "ok"
["data"]=>
object(stdClass)#19 (4) {
["id"]=>
int(38037809)
["type"]=>
string(4) "spot"
["state"]=>
string(7) "working"
["list"]=>
array(930) {
[0]=>
object(stdClass)#23 (4) {
["currency"]=>
string(3) "ioi"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[1]=>
object(stdClass)#30 (4) {
["currency"]=>
string(3) "ioi"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[2]=>
object(stdClass)#28 (4) {
["currency"]=>
string(3) "lun"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[3]=>
object(stdClass)#33 (4) {
["currency"]=>
string(3) "lun"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[4]=>
object(stdClass)#35 (4) {
["currency"]=>
string(3) "ksm"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[5]=>
object(stdClass)#15 (4) {
["currency"]=>
string(3) "ksm"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
xxxxxxxxxx
$user = json_decode(file_get_contents($analytics));
foreach($user->data as $mydata) {
echo $mydata->name . "\n";
foreach($mydata->values as $values)
{
echo $values->value . "\n";
}
}
xxxxxxxxxx
$jsonString = '{
"name": "John",
"age": 30,
"city": "New York"
}';
$jsonObject = json_decode($jsonString);
// Iterate through each element of the JSON object
foreach ($jsonObject as $key => $value) {
echo "Key: $key, Value: $value\n";
}
xxxxxxxxxx
object(stdClass)#5 (2) {
["status"]=>
string(2) "ok"
["data"]=>
object(stdClass)#19 (4) {
["id"]=>
int(38037809)
["type"]=>
string(4) "spot"
["state"]=>
string(7) "working"
["list"]=>
array(930) {
[0]=>
object(stdClass)#23 (4) {
["currency"]=>
string(3) "ioi"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[1]=>
object(stdClass)#30 (4) {
["currency"]=>
string(3) "ioi"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[2]=>
object(stdClass)#28 (4) {
["currency"]=>
string(3) "lun"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[3]=>
object(stdClass)#33 (4) {
["currency"]=>
string(3) "lun"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[4]=>
object(stdClass)#35 (4) {
["currency"]=>
string(3) "ksm"
["type"]=>
string(5) "trade"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
[5]=>
object(stdClass)#15 (4) {
["currency"]=>
string(3) "ksm"
["type"]=>
string(6) "frozen"
["balance"]=>
string(1) "0"
["seq-num"]=>
string(1) "0"
}
}