bmm bmm - 9 months ago 51
PHP Question

How to get a string from a stdclass object

So when I

var_dump($result);
I get
object(stdClass)#250 (1) { ["return"]=> string(7) "Success" }


Question, how can I get the "success" from the object in PHP?

Thank you.

Answer Source

In PHP to access an object's property you can use this syntax:

$object->property;

In your case should be

echo $result->return;