0

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 {

ganjan
  • 7,356
  • 24
  • 82
  • 133

1 Answers1

1

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

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

so yours would be

$$user->user1_ready

Brent
  • 23,354
  • 10
  • 44
  • 49