views:

20

answers:

1

Hi. I used var_dump on an object in my code. print var_dump( $$user);

result: object(stdClass)#35 (1) { ["user1_ready"]=> string(1) "0" } How do I get to this value (0 in this case).

I tried print $$user which resulted in Catchable fatal error: Object of class stdClass could not be converted to string in

I need something like if($$user == 0){echo "error message") else {

+1  A: 

You need to use the property/method accessor "->". It generally follows:

$object->method() or $object->property

so yours would be

$$user->user1_ready

UltimateBrent