4
How can I display all the values of a JSON in PHP ??
Let me give you an example, I use the Code below to request JSON
$json_file = file_get_contents("http://backpack.tf/api/IGetUsers/v3/?steamids=76561198012598620");The information contained in JSON is this:
$json_str = json_decode($json_file, true);
{ "response": { "success": 1, "current_time": 1400075229, "players": { "76561198012598620": { "steamid": "76561198012598620", "success": 1, "backpack_value": { "570": 5, "440": 126.9475 }, "backpack_update": { "570": 1399815523, "440": 1400024876 }, "name": "Fiskie", "backpack_tf_reputation": 2, "notifications": 0 } } } }But if I use
$nome = $json_str["name"]; echo "$nome";To display the value "name" the page seems not to load , the whole screen turns white..
How can I display the "name" value correctly ?
Thank you to all who can help me.
Thanks !! worked perfectly
– Leonardo Roberto