-2

identifier, code, type... I can handle operations with foreach. Lakin, I want to take part odds, unfortunately I get a " Object of class stdClass could not be error.

3
  • Where's the code where you're trying to use it? Commented Jun 16, 2017 at 1:49
  • foreach($json as $row){ if(isset($row->odds)){ echo $row->odds; } echo "<br><br>"; } Commented Jun 16, 2017 at 2:03
  • You need to access $object[0]->odds->{"SC.GG"} Commented Jun 16, 2017 at 2:03

1 Answer 1

1

odds is an object, not a string or number, so you can't echo it. You need to access the SC.GG property.

foreach($json as $row){ 
    if(isset($row->odds)){ 
        echo $row->odds->{"SC.CG"}; 
    } 
    echo "<br><br>"; 
} 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.