开发者

Get specific value from Object in PHP

开发者 https://www.devze.com 2023-01-04 16:05 出处:网络
<?php $开发者_Go百科a[\'registrationID\']=\"*******\"; $a[\'password\']=\"******\"; $a[\'smsPort\']=7424;
<?php

$开发者_Go百科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);
?>

This returns:

stdClass Object
(
    [ReceiveSMSResponse] => stdClass Object
        (
            [msgID] => 20100620202512840316
            [senderMSISDN] => 1732172782
            [timeStamp] => 6/20/2010 8:25:14 PM
            [msgContent] => testing
            [sourcePort] => 7424
        )

)

How do I get the different parts of the object and put them separately into strings? e.g. i want something like $msgcontent= //whatever is in [msgcontent]


Use the -> operator. In your specific example:

print($response->ReceiveSMSResponse->msgContent);

For more information, see: http://www.php.net/manual/en/language.oop5.properties.php

0

精彩评论

暂无评论...
验证码 换一张
取 消