i have response from API like this
"user_settings": {..},
"users_info": {
"success": true,
"data": {
"notable_users_pcr": 0.245714,
"users_with_pcr": 0.853978,
"users_type": [
{
"code": "town_1",
"weight": 0.134769
},
{
"code": "town_2",
"weight": 0.094154
},
{
"code": "town_3",
"weight": 0.16633
},
{
"code": "town_4",
"weight": 0.604747
}
],
"users_class": "low",
"users_reachability": [
{
"code": "-500",
"weight": 0.499692
},
{
"code": "500-1000",
"weight": 0.264352
},
{
"code": "1000-1500",
"weight": 0.101187
},
{
"code": "1500-",
"weight": 0.134769
}
],
i use CURL to fetch the data json_decode and everything work, but i cant get the data from users_reachability
i try like this but users_reachability not work to fetch the data row 0, 1, 2, 3,
$responeds = json_decode($authToken,true);
// Work
$get_success = $responeds['users_info']['success'];
// try those but not work
$get_success = $responeds['users_info']['data']['users_type];
$get_success = $responeds['users_info']['data']['users_type][0];
$get_success = $responeds['users_info']['data']['users_type][][0];
$get_success = $responeds['users_info']['data']['users_type][''][0];
errors shows up
Warning: Undefined array key "users_info" ..
Warning: Trying to access array offset on value of type null in ..
Warning: Trying to access array offset on value of type null in ..
Warning: Trying to access array offset on value of type null in ..
The Goal how can i get the value from users_info -> data -> users_type -> 1 OR 2 OR 3