I want to return a value from the below scripts :
$wsdl_url = 'http://srv.test/erProject/services/services?wsdl';
$client = new SOAPClient($wsdl_url);
$params = array(
'IPADDR' => "111.12.13.14",
);
$return = $client->getUserInfo($params);
print_r($return);
echo $return->getUserInfo->expiredate;
print_r work and return:
stdClass Object
(
[return] => stdClass Object
(
[UserCredit] => stdClass Object
(
[expiredate] => 23-02-2018
)
[resCode] => 1
)
)
but echo will return :
PHP Notice: Undefined property: stdClass::$UserCredit
PHP Notice: Trying to get property of non-object
Thanks in advance
print_r()shows the expected structure.$return->return->UserCredit->expiredate. The property of the object stored in$returnisreturn.getUserInfo($params)works, you can use thisecho $return->return->UserCredit->expiredate;