0
I receive this object in PHP (I could see the values with print_r):
stdClass Object ( [id] => 1 ) 1
Wanted to echo only id value (1), how to do?
0
I receive this object in PHP (I could see the values with print_r):
stdClass Object ( [id] => 1 ) 1
Wanted to echo only id value (1), how to do?
4
As you are receiving an object, you should access it in a similar way to an array. What changes is that instead of $variavel['id']
, you use $variavel->id
;
In your case, you get the result like this:
echo $objeto->id;
Browser other questions tagged php objects
You are not signed in. Login or sign up in order to post.