php webservices Catchable fatal error: Object of class stdClass could not be converted to string
php webservices Catchable fatal error: Object of class stdClass could not be converted to string
我正在从网络服务获取布尔值,var_dump:
object(stdClass)#2 (1) { ["CheckIfUserCridentialsAreValidResult"]=> bool(false) }
我试着把它放在 if 语句中,像这样:
if($response)
echo "TRUE";
else
echo "FALSE";
因为如果我这样做:
echo $response;
但后来我收到这条消息:
"Catchable fatal error: Object of class stdClass could not be converted to string".
我试图将变量严格定义为布尔值,但这也没有用。我想我需要做一个额外的步骤,我只是在 Google 或 Stack overflow 上找不到那个额外的步骤。
尝试:
if ($response->CheckIfUserCridentialsAreValidResult) { ...
我正在从网络服务获取布尔值,var_dump:
object(stdClass)#2 (1) { ["CheckIfUserCridentialsAreValidResult"]=> bool(false) }
我试着把它放在 if 语句中,像这样:
if($response)
echo "TRUE";
else
echo "FALSE";
因为如果我这样做:
echo $response;
但后来我收到这条消息:
"Catchable fatal error: Object of class stdClass could not be converted to string".
我试图将变量严格定义为布尔值,但这也没有用。我想我需要做一个额外的步骤,我只是在 Google 或 Stack overflow 上找不到那个额外的步骤。
尝试:
if ($response->CheckIfUserCridentialsAreValidResult) { ...