I want to be able to get the value of a php object without having to do $foo->value
. Similar to how a variable works ex.
$foo = "bar";
print $foo;
The line printed is bar
.
I want to be able to get the value of a php object without having to do $foo->value
. Similar to how a variable works ex.
$foo = "bar";
print $foo;
The line printed is bar
.
You could use print_r()
or var_dump()
or var_export()
to get a textual representation of your object.
Each of those functions is used by passing in an expression; it could be an object, an array, or a value.