This works and is tested.
PHP Code:
$data_stats = json_decode($ret);
$projected_points = $data_stats->body->player_stats->42550689->FPTS
I just need to know how to do it using a variable. Something like this:
PHP Code:
$data_stats = json_decode($ret);
$projected_points = $data_stats->body->player_stats->$id->FPTS
How can I make $id work here?
Also is this called extending a class? I don’t even know the correct terminology to describe my question.
I believe you can access attributes using alternative syntax
$obj->player_stats->{$var}