0

Iam getting a boolean from a webservices, var_dump:

object(stdClass)#2 (1) { ["CheckIfUserCridentialsAreValidResult"]=> bool(false) } 

i tried to put it in a if statement, like this:

if($response)
   echo "TRUE";
else 
   echo "FALSE";

because if i just do:

echo $response;

But then I get this message:

"Catchable fatal error: Object of class stdClass could not be converted to string".

I tried to strictly define the variable as a Boolean, but that also didn't work. I think i need to do an extra step, i just can not find that extra step on Google or on Stack overflow.

2
  • What are you trying to do? Commented Jul 16, 2015 at 19:51
  • iam getting a Boolean from a webservice, and then I want to work with it like a Boolean created in a normal php script. if i put the variable in a if statement. It sees it as alwase TRUE so even if the Boolean that i get from the webservices is FALSE.. But i dont know how to get the TRUE or FALSE from the BOolean. Commented Jul 16, 2015 at 19:55

1 Answer 1

1

Try:

if ($response->CheckIfUserCridentialsAreValidResult) { ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.