简体   繁体   English

如何在PHP中获取stdclass对象值

[英]how to get stdclass object value in php

stdClass Object
(
[Transaction] => stdClass Object
    (
        [Reference1] => 001
        [Reference2] => 
        [Reference3] => 
        [Reference4] => 
        [Reference5] => 
    )

[Notifications] => stdClass Object
    (
    )

[HasErrors] => 
[Shipments] => stdClass Object
    (
        [ProcessedShipment] => stdClass Object
            (
                [ID] => 3702106321
                [Reference1] => Shpt 0001
                [Reference2] => 
                [Reference3] => 
                [ForeignHAWB] => 
                [HasErrors] => 
                [Notifications] => stdClass Object
                    (
                    )

                [ShipmentLabel] => stdClass Object
                    (
                        [LabelURL] => http://www.sandbox.aramex.com/content/rpt_cache/cc1703518ef04f13873f8c2a2fab04fb.pdf
                        [LabelFileContents] => 
                    )
            )
    )

)

Can anyone help me how do I retrieve the value of ID? 谁能帮我如何获取ID的值?

Something like this: 像这样:

$your_object->Shipments->ProcessedShipment->ID

where, $your_object contains your response, that you posted here. 其中, $your_object包含您在此处发布的响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM