如何打印此嵌套 stdClass 对象中的数据?

0 php soap stdclass

我正在尝试打印此嵌套 stdClass 对象中的值,但访问它们时遇到问题。例如,如何打印“originCity”的值?

stdClass Object (
    [FlightInfoResult] => stdClass Object (
        [next_offset] => 1 
        [flights] => stdClass Object (
            [ident] => SWA2558
            [aircrafttype] => B737
            [filed_ete] => 00:50:00
            [filed_time] => 1362879561
            [filed_departuretime] => 1362880080
            [filed_airspeed_kts] => 442
            [filed_airspeed_mach] => 
            [filed_altitude] => 410
            [route] => LBY MEI J31 VUZ
            [actualdeparturetime] => 1362880080
            [estimatedarrivaltime] => 1362882900
            [actualarrivaltime] => 1362882600
            [diverted] => [origin] => KMSY
            [destination] => KBHM
            [originName] => New Orleans Intl
            [originCity] => New Orleans, LA
            [destinationName] => Birmingham-Shuttlesworth Intl
            [destinationCity] => Birmingham, AL
        )
    )
)
Run Code Online (Sandbox Code Playgroud)

Phi*_*ipp 5

尝试

$var->FlightInfoResult->flights->originCity
Run Code Online (Sandbox Code Playgroud)