I'm writing a relatively simple if statement to process the response of a web-service
The below code will output the type of data that's being returned and the value of it:
$response = $client->__getLastResponse();
echo $response;
echo gettype($response);
For a correct response, I get 'true string'
For an incorrect response, I get 'false string'
So I need an if statement to process whether it's true or false:
if($response == "true"){
    echo "Logged In";
} else {
    echo "Not Logged In";
}
Whatever response I get, I always receive "Not Logged In"
I've tried the === operator also, but to no avail.
Can someone help?
"true string"it means the response variable contains"true "(with a final space), not"true". Also,var_dump($response)is a cleaner way of displaying values and types - can you tell us what it outputs ?true stringyou get or justtrueas a string?