如何从magento中的数组中获取单个对象值?

i am trying to calculate shipping charge and i am getting a response from REST API. i want to get return the value of "delivery_charges" form response array?

Array
(
[response] => Array
    (
        [delivery_charges] => 41
        [return_charges] => 83
        [all_charges] => Array
            (
                [DL] => 32
                [FS] => 30
                [DTO] => 0
                [RTO] => 32
                [ST] => 14.5
                [COD] => 0
                [TDS] => 0
                [CARD] => 0
                [CNC] => 0
            )

        [canc_charges] => 0
        [pickup_charges] => 0
        [params] => Array
            (
                [md] => E
                [pt] => prepaid
                [cl] => xxxxxxx
                [o_pin] => 560076
                [d_pin] => 560062
                [token] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                [gm] => 100
                [d_city] => Bangalore
                [o_city] => Bangalore
            )

    )

)

i got answer by just using

return $shipping_charge['response']['delivery_charges'];

You need to simply add the following at the end. If $shipping_charge is the array then write:

return $shipping_charge['response']['delivery_charges'];