bmm bmm - 20 days ago 5
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

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

$object->property;

In your case should be

echo $result->return;