Anyone know how to assign stdClass value to variable?
I have a stdClass object and when I print it using var_dump($userdetails->emailaddress), it does print out the value as String(31)"[email protected]";
but when I try to assign the object value to variable, lets say:
$to = $userdetails->emailaddress;
the $to value become NULL ...
Anyone can help ?
php -r '$x = new stdClass; $x->foo = "bar"; $foo = $x->foo; var_dump($foo);'It will print "bar". Paste your actual code, there's probably something else wrong with it.