0

Here is the JSON result and I will like to get fetch out ["address"] and ["network"] using PHP

array(2) {
  ["status"]=>
  string(7) "success"
  ["data"]=>
  array(4) {
    ["network"]=>
    string(3) "BTC"
    ["user_id"]=>
    int(20)
    ["address"]=>
    string(34) "3DHSXwP49f6iLLfQXUQTFxPcedJdy4v8ii"
    ["label"]=>
    string(7) "ndaga81"
  }
}
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
Babken
  • 27
  • 2

1 Answers1

1

Decode the json and then get the data based on indexes

$array = json_decode($json,true);

echo $array['data']['network'];
echo $array['data']['address'];

Sample output:- https://eval.in/1005728

Reference:-

json_decode()

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98