Using PHP, I have to parse a string coming to my code in a format like this:
object(stdClass)(4) { [\"Title\"]=> string(5) \"Fruit\" [\"Color\"]
Example StdClass Object:
$obj = new stdClass(); $obj->foo = "bar";
By Property (as other's have mentioned)
echo $obj->foo; // -> "bar"
By variable's value:
$my_foo = 'foo'; echo $obj->{$my_foo}; // -> "bar"