<?php
$a['registrationID']="*******";
$a['password']="******";
$a['smsPort']=7424;
$a['msgID']=0;
$soap_url='http://localhost/WebService_GP_ADP_BizTalk_SMS_Orchestrations.wsdl';
$soap = new SoapClient($soap_url);
$response=$soap->getReceivedSMS( array ("ReceiveSMSRequest" => $a) );
print_r($response);
?>
返回:
stdClass Object
(
[ReceiveSMSResponse] => stdClass Object
(
[msgID] => 20100620202512840316
[senderMSISDN] => 1732172782
[timeStamp] => 6/20/2010 8:25:14 PM
[msgContent] => testing
[sourcePort] => 7424
)
)
如何获取对象的不同部分并将它们分别放入字符串? 例如我想要一些像$ msgcontent = // [msgcontent]
中的内容答案 0 :(得分:0)
使用->
运算符。在您的具体示例中:
print($response->ReceiveSMSResponse->msgContent);
有关详细信息,请参阅:http://www.php.net/manual/en/language.oop5.properties.php